| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using CoreFS.CA06;
- using System;
- using System.Data;
- using System.Linq;
- namespace Core.StlMes.Client.Qcm
- {
- public partial class ComBasePlineChoice : FrmBase
- {
- private string _plineCodes = "";
- public string PlineCodes
- {
- get { return _plineCodes; }
- set { _plineCodes = value; }
- }
- private string _plineNames = "";
- public string PlineNames
- {
- get { return _plineNames; }
- set { _plineNames = value; }
- }
- private string _processCode = "";
- public ComBasePlineChoice(string plineCodes, string processCode, OpeBase ob)
- {
- InitializeComponent();
- this._plineCodes = plineCodes;
- _processCode = processCode;
- this.ob = ob;
- Query();
- }
- private void Query()
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ProductionLineInfo.QueryAll",
- new object[] { _processCode }, ob);
- string[] plineCodes = _plineCodes.Split(',');
- foreach (DataRow row in dt.Rows)
- {
- if (plineCodes.Contains(row["PLINE_CODE"].ToString()))
- {
- row["CHK"] = true;
- }
- }
- dt.DefaultView.Sort = "CHK DESC, PLINE_NAME ASC";
- GridHelper.CopyDataToDatatable(dt.DefaultView.ToTable(), dataTable1, true);
- ultraGrid1.UpdateData();
- }
- private void ultraButton1_Click(object sender, EventArgs e)
- {
- ultraGrid1.UpdateData();
- var rows = ultraGrid1.Rows.Where(a => a.GetValue("CHK") == "True");
- _plineCodes = string.Join(",", rows.Select(a => a.GetValue("PLINE_CODE")));
- _plineNames = string.Join(",", rows.Select(a => a.GetValue("PLINE_NAME")));
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- private void ultraButton2_Click(object sender, EventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- }
- }
- }
|