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 Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Tool; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using Pur.Entity; using Pur.Entity.configureEntity; namespace Pur.Pop_upWindow { public partial class frmPopActualSeat : FrmPmsBase { private string deliveryLocation; private string deliveryLocationCode; private string tips; public string Tips { get { return tips; } set { tips = value; } } private string isJit="0"; public string DeliveryLocationCode { get { return deliveryLocationCode; } set { deliveryLocationCode = value; } } public string DeliveryLocation { get { return deliveryLocation; } set { deliveryLocation = value; } } public frmPopActualSeat() { InitializeComponent(); } public frmPopActualSeat(OpeBase OB,String strIsJit) { this.isJit = strIsJit; this.ob = OB; InitializeComponent(); } //load private void frmPopActualSeat_Load(object sender, EventArgs e) { init(); } private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "doRefresh": // ButtonTool init(); break; case "doSure": // ButtonTool doSure(); break; case "doClear": // ButtonTool doClear(); break; case "doClose": // ButtonTool this.Close(); break; } } //清空 private void doClear() { deliveryLocation=""; deliveryLocationCode=""; tips = "1"; this.Close(); } //选择 private void doSure() { UltraGridRow row = ultraGrid1.ActiveRow; getData(row); } //选择行 private void getData(UltraGridRow row) { try { if (row == null) { MessageUtil.ShowTips("请选交付地点"); return; } String strdeliveryLocation = row.GetCellValue("invPhysicName").ToString().Trim(); String strdeliveryLocationCode = row.GetCellValue("invPhysic").ToString().Trim(); if (String.IsNullOrEmpty(strdeliveryLocation) && String.IsNullOrEmpty(strdeliveryLocationCode)) { MessageUtil.ShowTips("数据异常,交付地点和地点编码都不能空"); return; } deliveryLocation = strdeliveryLocation; deliveryLocationCode = strdeliveryLocationCode; tips = "1"; this.Close(); } catch (Exception ex) { MessageUtil.ShowTips("操作失败:"+ex); } } //加载数据 private void init() { try { this.Cursor = Cursors.WaitCursor; tips = "0"; dataSet1.Clear(); PhysicSeatEntity Phouse = new PhysicSeatEntity(); Phouse.Validflag = "1"; Phouse.InvPhysic = tbxPhysicQ.Text.ToString().Trim(); Phouse.InvPhysicName = tbxPhysicNameQ.Text.ToString().Trim(); if (isJit != "0") { Phouse.OrgId = UserInfo.GetDeptid(); } DataTable dt = this.execute("com.hnshituo.pur.configure.service.ActualSeatService", "getActualSeat", new object[] { Phouse, 0, 0 }); if (dt != null) { GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true); } } catch (Exception ex) { MessageBox.Show("查询失败:" + ex.Message); } finally { this.Cursor = Cursors.Default; } } //双击选择 private void ultraGrid1_DoubleClickCell(object sender, Infragistics.Win.UltraWinGrid.DoubleClickCellEventArgs e) { //UltraGridRow row = e.Cell.Row; getData(e.Cell.Row); } } }