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.

63 lines
1.8 KiB
C#

1 year ago
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")); //取消
}
}
}