69 lines
2.1 KiB
C#
69 lines
2.1 KiB
C#
using HandyControl.Controls;
|
|
using SqlSugar;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows;
|
|
using WCS.BLL.DbModels;
|
|
using WCS.Model;
|
|
using WCS.Model.ApiModel.MatBaseInfo;
|
|
using 货架标准上位机.Api;
|
|
using 货架标准上位机.ViewModel;
|
|
|
|
namespace 货架标准上位机
|
|
{
|
|
public partial class MatBaseInoGenarateMatInfoView : System.Windows.Window
|
|
{
|
|
|
|
public MatBaseInfoModel matBaseInfo = null;
|
|
|
|
|
|
public MatBaseInoGenarateMatInfoView(MatBaseInfoModel _matBaseInfo = null)
|
|
{
|
|
InitializeComponent();
|
|
if (_matBaseInfo != null)
|
|
{
|
|
matBaseInfo = _matBaseInfo;
|
|
//绑定数据
|
|
txtMatCode.Text = matBaseInfo.MatCode;
|
|
txtMatName.Text = matBaseInfo.MatName;
|
|
txtMatSpec.Text = matBaseInfo.MatSpec;
|
|
txtMatCustomer.Text = matBaseInfo.MatCustomer;
|
|
}
|
|
}
|
|
|
|
|
|
private void btnOk_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
#region 调用接口生成条码
|
|
try
|
|
{
|
|
var body = new GenerateMatInfoRequest()
|
|
{
|
|
MatBaseInfo = matBaseInfo,
|
|
TotalCount = Convert.ToInt32(txtTotalCount.Text),
|
|
MatQty = Convert.ToInt32(txtMatQty.Text),
|
|
};
|
|
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<MatInfoModel>>>(LocalFile.Config.ApiIpHost + "matBaseInfo/generateMatInfo", body, "POST");
|
|
if (Result != null && Result.Data != null && Result.Data.Count > 0)
|
|
{
|
|
Growl.Success("生成成功!");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Growl.Error("加载数据失败:" + ex.Message);
|
|
}
|
|
#endregion
|
|
|
|
this.DialogResult = true;
|
|
this.Close();
|
|
}
|
|
|
|
private void closeClick(object sender, RoutedEventArgs e)
|
|
{
|
|
this.DialogResult = false;
|
|
this.Close();
|
|
}
|
|
}
|
|
}
|