using DevExpress.DataProcessing; using Mesnac.Action.ChemicalWeighing.Entity; using Microsoft.Office.Interop.Excel; 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.Warehouse { public partial class UpdateWareHouse : Form { public Hw_Warehouse _wh = null; public ActionType _actionType; public UpdateWareHouse() { InitializeComponent(); } public UpdateWareHouse(ActionType type, int selectId,string name,string barCode) { InitializeComponent(); _actionType= type; _wh = new Hw_Warehouse(); _wh.ID = selectId; _wh.Name = name; _wh.BarCode = barCode; } private void btnOk_Click(object sender, EventArgs e) { if (WarehouseHelper.IsExistsCode(this.txtBarCode.Text, _wh.ID)) { MessageBox.Show("条码重复!", Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } _wh.Name = this.txtName.Text; _wh.BarCode = this.txtBarCode.Text; this.DialogResult = System.Windows.Forms.DialogResult.OK; } private void UpdateWareHouse_Load(object sender, EventArgs e) { this.txtName.Text = _wh.Name; this.txtBarCode.Text = _wh.BarCode; } } }