You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.7 KiB
C#

1 year ago
using ICSharpCode.Core;
using Mesnac.Action.ChemicalWeighing.Entity;
using System;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.CylinderManage
{
public partial class FrmInsert : Form
{
public Hw_Cylinder _hw = null;
public FrmInsert()
{
InitializeComponent();
_hw = new Hw_Cylinder();
}
private void btnOk_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(txtName.Text))
{
MessageBox.Show("名称不能为空!!");
this.txtName.Focus();
return;
}
if (string.IsNullOrEmpty(txtBarCode.Text))
{
MessageBox.Show("条码不能为空!!");
this.txtBarCode.Focus();
return;
}
_hw.Name = this.txtName.Text;
_hw.BarCode = this.txtBarCode.Text;
//桶条码唯一性验证
if (CylinderHelper.QueryIsExe(_hw.Name, _hw.BarCode))
{
MessageBox.Show("名称或条码已存在!!请更改重试!!");
return;
}
this.DialogResult = System.Windows.Forms.DialogResult.OK;
}
private void FrmInsert_Load(object sender, EventArgs e)
{
this.btnOk.Text = StringParser.Parse(ResourceService.GetString("Mesnac_Dialog_btnOK")); //确定
this.btnCancel.Text = StringParser.Parse(ResourceService.GetString("Mesnac_Dialog_btnCancel")); //取消
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Dispose();
}
}
}