using ICSharpCode.Core; using Mesnac.Action.ChemicalWeighing.Entity; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Mesnac.Action.ChemicalWeighing.PumpManage { public partial class FrmInsert : Form { public Hw_Pump _hw = null; public FrmInsert() { InitializeComponent(); _hw=new Hw_Pump(); } 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 (PumpHelper.QueryIsExe(_hw.Name, _hw.BarCode)) { MessageBox.Show("名称或条码已存在!!请更改重试!!"); return; } this.DialogResult = System.Windows.Forms.DialogResult.OK; } private void btnCancel_Click(object sender, EventArgs e) { this.Dispose(); } 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")); //取消 } } }