using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using CoreFS.CA06; using System; using System.Collections; using System.Data; using System.Linq; namespace Core.StlMes.Client.Qcm { public partial class ZgSpecConfirmPopup : FrmBase { private string _maxD = ""; private string _maxH = ""; private string _processCodeC = ""; private string _designKey = ""; private string _ordLnPk = ""; private string _mscPline = ""; public ZgSpecConfirmPopup(string maxD, string maxH, string processCodeC, string designKey, string ordLnPk, string mscPline, OpeBase ob) { InitializeComponent(); this.ob = ob; _maxD = maxD; _maxH = maxH; _processCodeC = processCodeC; _designKey = designKey; _mscPline = mscPline; _ordLnPk = ordLnPk; Query(); } public void Query() { DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.ZgSpecConfirm.Query", new object[] { new string[] { _ordLnPk, _mscPline, _processCodeC, _maxD, _maxH, _designKey } }, ob); GridHelper.CopyDataToDatatable(dt, this.dataTable1, true); } public void Save() { ultraGrid1.UpdateData(); ArrayList list = new ArrayList(); var rows = ultraGrid1.Rows.Where(a => a.GetValue("Chk") == "True"); foreach (var row in rows) { string[] parm = new string[] { _ordLnPk, _mscPline, row.GetValue("GRADECODE"), row.GetValue("GRADENAME"),row.GetValue("DIMATER"), row.GetValue("HEIGHT") }; list.Add(parm); } if (MessageUtil.ShowYesNoAndQuestion("是否确认保存?") == System.Windows.Forms.DialogResult.No) { return; } ServerHelper.SetData("com.steering.pss.sale.order.ZgSpecConfirm.Save", new object[] { list, _ordLnPk, _mscPline }, ob); MessageUtil.ShowTips("保存成功!"); } private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "保存": Save(); break; case "关闭": this.Close(); break; } } private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { ultraGrid1.UpdateData(); //var row = ultraGrid1.Rows.Where(a => a.GetValue("GradeCode") == e.Cell.Row.GetValue("GradeCode") && // e.Cell.Row != a && a.GetValue("Chk") == "True").FirstOrDefault(); //if (row != null) //{ // row.Cells["Chk"].Value = false; // row.Update(); //} //e.Cell.Row.Update(); } } }