| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- 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.Data;
- using System.Linq;
- namespace Core.StlMes.Client.Qcm
- {
- public partial class MscChoicePopup : FrmBase
- {
- private string _stdCode = "";
- private string _steelCode = "";
- private string _msc = "";
- private string _pscBl = "";
- private string _mscSet = "";
- public MscChoicePopup(OpeBase ob, string stdCode, string steelCode, string msc,
- string pscBl, string mscSet)
- {
- InitializeComponent();
- this.ob = ob;
- _stdCode = stdCode;
- _steelCode = steelCode;
- _msc = msc;
- _pscBl = pscBl;
- _mscSet = mscSet;
- query();
- }
- private void query()
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.MscChoicePopup.getChoiceMsc",
- new object[] { _stdCode, _steelCode }, ob);
- ultraGrid1.BeginUpdate();
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- foreach (var row in ultraGrid1.Rows)
- {
- if (_mscSet.Contains(row.GetValue("MSC")))
- {
- row.Cells["Chk"].Value = true;
- row.Update();
- }
- }
- SortRows();
- ultraGrid1.EndUpdate();
- ultraGrid1.UpdateData();
- }
- private void SortRows()
- {
- DataTable sortDt = dataTable1.Copy();
- sortDt.DefaultView.Sort = "Chk DESC, MSC ASC";
- GridHelper.CopyDataToDatatable(sortDt.DefaultView.ToTable(), dataTable1, true);
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "查询":
- query();
- break;
- case "确认":
- Submit();
- break;
- case "关闭":
- this.Close();
- break;
- }
- }
- private void Submit()
- {
- var rows = ultraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- string mscSet = string.Join(";", rows.Select(a => a.GetValue("MSC")).ToArray());
- string mscDescSet = string.Join(";", rows.Select(a => a.GetValue("MSC_DESC")).ToArray());
- ServerHelper.SetData("com.steering.pss.qcm.MscChoicePopup.updateMscSet",
- new object[] { mscSet, mscDescSet, _msc, _pscBl }, ob);
- MessageUtil.ShowTips("操作成功!");
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- e.Cell.Row.Update();
- }
- }
- }
|