You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
using BBWY.Controls;
|
|
using System.Windows;
|
|
|
|
namespace BBWY.Client.Views.BatchPurchase
|
|
{
|
|
/// <summary>
|
|
/// EditQuantityRatioWindow.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class EditQuantityRatioWindow : BWindow
|
|
{
|
|
public int QuantityRatio;
|
|
|
|
public EditQuantityRatioWindow(int quantityRatio)
|
|
{
|
|
InitializeComponent();
|
|
this.QuantityRatio = quantityRatio;
|
|
this.Loaded += EditQuantityRatioWindow_Loaded;
|
|
}
|
|
|
|
private void EditQuantityRatioWindow_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
txt_quantityRatio.Text = QuantityRatio.ToString();
|
|
}
|
|
|
|
private void btn_Save_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!int.TryParse(txt_quantityRatio.Text, out int quantityRatio))
|
|
{
|
|
MessageBox.Show("无效数字", "提示");
|
|
return;
|
|
}
|
|
if (quantityRatio <= 0)
|
|
{
|
|
MessageBox.Show("无效数字", "提示");
|
|
return;
|
|
}
|
|
|
|
this.QuantityRatio = quantityRatio;
|
|
this.DialogResult = true;
|
|
this.Close();
|
|
}
|
|
}
|
|
}
|
|
|