using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Judge.Commons; using CoreFS.CA06; using System; using System.Collections.Generic; using System.Data; using System.Windows.Forms; namespace Core.StlMes.Client.Judge.Controls { public partial class QcmZbsCraftResultCtrl : UserControl { private Dal _d; public QcmZbsCraftResultCtrl(Control container, OpeBase ob) { InitializeComponent(); container.Controls.Add(this); this.Dock = DockStyle.Fill; _d = new Dal(ob); } public void Query(string zbsId) { DataTable dt = _d.GetTableByXmlId("JdgQcmZbsCraftResult.getByZbsId", zbsId); GridHelper.CopyDataToDatatable(dt, dataTable1, true); GridHelper.RefreshAndAutoSize(ultraGrid1); } public void Modify() { List jsons = new List(); foreach (DataRow dr in dataTable1.Rows) { if (dr["chk"].ToString() == "False") continue; jsons.Add(JsonHelper.ToJson(dr)); } if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") == DialogResult.No) { return; } var ccp = _d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.modifyZbsCraft", jsons); if (ccp.ReturnInfo.ToString2() != "") { MessageUtil.ShowWarning(ccp.ReturnInfo.ToString2()); } else { MessageUtil.ShowTips("修改成功!"); } } public void ClearData() { dataTable1.Clear(); } private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { e.Cell.Row.Update(); } } }