using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using System; using System.Data; using System.Linq; namespace Core.StlMes.Client.Qcm { public partial class FrmProcess : FrmBase { public FrmProcess() { InitializeComponent(); ExceptionHelper.RegistException(); } private OpeBase ob1; public OpeBase Ob1 { get { return ob1; } set { ob1 = value; } } private string code; public string Code { get { return code; } set { code = value; } } private string desc; public string Desc { get { return desc; } set { desc = value; } } private string processStyle = ""; public string ProcessStyle { get { return processStyle; } set { processStyle = value; } } //查询 public void DoQuery() { DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.getSecProcess", new Object[] { processStyle }, this.Ob1); GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true); } /// /// 初始被选择项 /// private void SetSelect() { if (desc.Equals("")) return; string[] str = desc.Split('|'); for (int i = 0; i < ultraGrid1.Rows.Count; i++) { if (str.Contains(ultraGrid1.Rows[i].Cells["PROCESS_DESC_C"].Value.ToString())) { this.ultraGrid1.Rows[i].Cells["CHK"].Value = true; } } ultraGrid1.UpdateData(); } private void button1_Click(object sender, EventArgs e) { ultraGrid1.UpdateData(); UltraGridRow row = null; string modelcode = ""; string modeldesc = ""; for (int i = 0; i < ultraGrid1.Rows.Count; i++) { row = ultraGrid1.Rows[i]; if (Convert.ToBoolean(row.Cells["CHK"].Value)) { if (modelcode == "") modelcode = row.Cells["PROCESS_CDOE_C"].Value.ToString(); else modelcode = modelcode + "|" + row.Cells["PROCESS_CDOE_C"].Value.ToString(); if (modeldesc == "") modeldesc = row.Cells["PROCESS_DESC_C"].Value.ToString(); else modeldesc = modeldesc + "|" + row.Cells["PROCESS_DESC_C"].Value.ToString(); } } this.Code = modelcode; this.Desc = modeldesc; this.Close(); } private void button2_Click(object sender, EventArgs e) { this.Close(); } private void FrmProcess_Load(object sender, EventArgs e) { DoQuery(); SetSelect(); } private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { ultraGrid1.UpdateData(); } } }