using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Text; using System.Windows.Forms; using CoreFS.CA06;using Pur.Entity; using Pur.Entity.pur_orderEntiy; using Core.Mes.Client.Comm.Control; using Infragistics.Win.UltraWinGrid; using Pur.Entity; using Core.Mes.Client.Comm.Server; using Pur.order; namespace Pur.Pop_upWindow { public partial class FrmPopOrderModeNew : FrmPmsBase { private string tips_OrderType=""; public FrmPopOrderModeNew() { InitializeComponent(); } public FrmPopOrderModeNew(OpeBase ob,String strtips) { this.tips_OrderType = strtips; this.ob = ob; InitializeComponent(); } public FrmPopOrderModeNew(OpeBase ob) { this.ob = ob; InitializeComponent(); } private string modeId; public string ModeId { get { return modeId; } set { modeId = value; } } private string modeName; public string ModeName { get { return modeName; } set { modeName = value; } } private string modeDesc; public string ModeDesc { get { return modeDesc; } set { modeDesc = value; } } private string orderId; public string OrderId { get { return orderId; } set { orderId = value; } } private void FrmPopOrderModeNew_Load(object sender, EventArgs e) { GridHelper.SetExcludeColumnsActive(ultraGrid1.DisplayLayout.Bands[0], new string[] { }); GridHelper.SetExcludeColumnsActive(ultraGrid2.DisplayLayout.Bands[0], new string[] { }); DataTable dt1 = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { "1200" }, this.ob); comm.FilComboboxAdd(cop_orderType, dt1, "baseCode", "baseName", "validflag NOT in ('0')", true, "全部", ""); if (tips_OrderType == "") { cop_orderType.SelectedIndex = 0; } else { cop_orderType.Value = tips_OrderType; } ultraExpandableGroupBox1.Expanded = false; doQuery(); } private void barsManagerButon_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key.ToString()) { case "Query": doQuery(); break; case "conFirmation": doSelect(); break; case "ESC": this.Close(); break; } } #region toolbar事件 private void doSelect() { UltraGridRow uge = ultraGrid1.ActiveRow; if (uge == null) { MessageBox.Show("请选择合同模板!"); return; } this.modeDesc = uge.Cells["modeDesc"].Value.ToString().Trim(); this.modeId = uge.Cells["modeId"].Value.ToString().Trim(); this.modeName = uge.Cells["modeName"].Value.ToString().Trim(); this.Close(); } private void doQuery() { OrderModeM Omg = new OrderModeM(); Omg.ModeId = txt_CopModeId.Text.Trim(); Omg.ModeName = txt_CopModeName.Text.Trim(); Omg.OrderType = cop_orderType.Value.ToString().Trim(); Omg.Validflag = "1"; DataTable dt = this.execute("com.hnshituo.pur.order.service.OrderModeMService", "find_ModeM", new object[] { Omg, 0, 0 }); GridHelper.CopyDataToDatatable(dt, dataTable1, true); GridHelper.RefreshAndAutoSize(ultraGrid1); //加载合同资源 //加载合同 OrderM Odm = new OrderM(); Odm.OrderType = cop_orderType2.Value == null ? null : cop_orderType2.Value.ToString().Trim(); Odm.OrderId = COP_OrderId.Text.ToString().Trim(); Odm.SuppName = COP_SuppName.Text.ToString().Trim(); Odm.UpdateName = txt_itemName.Text.ToString().Trim(); Odm.Validflag = "1"; Odm.ValidDataPurviewIds = this.ValidDataPurviewIds; //string strDataFlag = this.execute("com.hnshituo.pur.utils.service.UtilsService", "getRoleDataFlag", new object[] { UserInfo.GetUserID(), "Pur.ck.PurExcDeliveryNoticeManagement" }); DataTable dt1 = this.execute("com.hnshituo.pur.order.service.OrderMService", "find_canUseOrderM", new object[] { Odm, 0, 0 }); GridHelper.CopyDataToDatatable(dt1, dataTable3, true); GridHelper.RefreshAndAutoSize(ultraGrid3); } #endregion #region 界面事件 private void ultraGrid1_ClickCell(object sender, ClickCellEventArgs e) { UltraGridRow uge = ultraGrid1.ActiveRow; if (uge != null) { OrderModeC Omc = new OrderModeC(); Omc.ModeId = uge.Cells["ModeId"].Value.ToString(); DataTable dt = this.execute("com.hnshituo.pur.order.service.OrderModeCService", "find_ModeC", new object[] { Omc, 0, 0 }); GridHelper.CopyDataToDatatable(dt, dataTable2, true); } } #endregion } }