Files
wcs/货架标准上位机/Views/MatDetailStocktakingInfoUpdateView.xaml.cs
2025-01-24 16:37:18 +08:00

77 lines
2.3 KiB
C#

using HandyControl.Controls;
using SqlSugar;
using System;
using System.Windows;
using WCS.BLL.DbModels;
using WCS.Model.ApiModel.Stocktaking;
using .ViewModel;
namespace
{
public partial class MatDetailStocktakingInfoUpdateView : System.Windows.Window
{
public MatDetailStocktakingInfoModel matDetailStocktakingInfo = null;
public MatDetailStocktakingInfoUpdateView(string _titleText, MatDetailStocktakingInfoModel _matDetailStocktakingInfo = null)
{
InitializeComponent();
if (_matDetailStocktakingInfo != null)
{
matDetailStocktakingInfo = _matDetailStocktakingInfo;
//绑定数据
MatCode.Text = matDetailStocktakingInfo.MatCode;
MatName.Text = matDetailStocktakingInfo.MatName;
MatSpec.Text = matDetailStocktakingInfo.MatSpec;
ShelfCode.Text = matDetailStocktakingInfo.ShelfCode;
ShelfArea.Text = matDetailStocktakingInfo.ShelfArea;
MatQty.Text = matDetailStocktakingInfo.MatQty.ToString();
StocktakingQty.Text = matDetailStocktakingInfo.StocktakingQty.ToString();
}
//绑定标题
if (!string.IsNullOrEmpty(_titleText))
{
Title.Text = _titleText;
}
}
private void btnOk_Click(object sender, RoutedEventArgs e)
{
try
{
int.Parse(StocktakingQty.Text);
}
catch
{
HandyControl.Controls.MessageBox.Show("盘点数量请输入有效数字!");
StocktakingQty.Focus();
StocktakingQty.SelectionStart = StocktakingQty.Text.Length;
return;
}
matDetailStocktakingInfo.StocktakingQty = int.Parse(StocktakingQty.Text); ;
this.DialogResult = true;
this.Close();
}
private void closeClick(object sender, RoutedEventArgs e)
{
this.DialogResult = false;
this.Close();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
StocktakingQty.Focus();
StocktakingQty.SelectionStart = StocktakingQty.Text.Length;
}
}
}