using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using com.hnshituo.pur.vo; using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Tool; using Pur.Entity; namespace Pur.configure { public partial class frmMaintainBaseInfoJL : FrmPmsBase { public frmMaintainBaseInfoJL() { InitializeComponent(); } private void frmMaintainBaseInfoJL_Load(object sender, EventArgs e) { txt_recordType.SelectedIndex = 0; } #region toolbar工具区 public override void ToolBar_Click(object sender, string ToolBarKey)//toolbar { switch (ToolBarKey) { case "Query"://查询物理库区数据 doQuery(); break; case "exit"://关闭窗口 this.Close(); break; } } //查询 private void doQuery() { try { this.Cursor = Cursors.WaitCursor; if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[0]) { mat.Clear(); // 加载计量物料数据 MatJl matjl = new MatJl(); matjl.Materielcode = txt_itemCodeJL.Text.Trim(); matjl.Materielname = txt_matNameJL.Text.Trim(); matjl.Erpcode = txt_matCodePMS.Text.Trim(); DataTable dt = this.execute("com.hnshituo.pur.jl.service.MeasureService", "getWMMatCodeAll", new object[] { matjl }); if (dt != null) { GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true); GridHelper.RefreshAndAutoSize(ultraGrid1); } } else { //加载计量供应商数据 supp.Clear(); SuppJl suppjl = new SuppJl(); suppjl.Unitcode = txt_suppCodeJL.Text.Trim(); suppjl.Unitname = txt_suppNameJL.Text.Trim(); suppjl.Erpcode = txt_suppCodePMS.Text.Trim(); suppjl.Recordtype = txt_recordType.Value.ToString().Trim(); DataTable dt1 = this.execute("com.hnshituo.pur.jl.service.MeasureService", "getWMSuppCodeAll", new object[] { suppjl }); if (dt1 != null) { GridHelper.CopyDataToDatatable(ref dt1, ref dataTable2, true); GridHelper.RefreshAndAutoSize(ultraGrid2); } } } catch (Exception ex) { MessageBox.Show("查询失败:" + ex.Message); } finally { this.Cursor = Cursors.Default; } } #endregion } }