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(); } } }