| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using com.steering.mes.mcp.entity;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Mcp.Mch.MchResult
- {
- public partial class FrmSetPlineGx : FrmBase
- {
- private string _gxs = "";
- public string Gxs { get { return _gxs; } }
- private string _gxNames = "";
- public string GxNames { get { return _gxNames; } }
- public FrmSetPlineGx()
- {
- InitializeComponent();
- }
- public FrmSetPlineGx(string gxs, OpeBase ob)
- {
- InitializeComponent();
- this.ob = ob;
- if (gxs != "")
- {
- foreach (string gx in gxs.Split(';'))
- {
- DataRow dr = dataTable1.NewRow();
- dr["CHK"] = true;
- dr["BASENAME"] = gx;
- dataTable1.Rows.Add(dr);
- }
- }
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "Save":
- Save();
- break;
- case "Close":
- Clo();
- break;
- }
- }
-
- private void Clo()
- {
- this.DialogResult = DialogResult.No;
- }
- /// <summary>
- /// 新增
- /// </summary>
- private void Save()
- {
- ultraGrid1.UpdateData();
- var checkRows = ultraGrid1.Rows.AsEnumerable().Where(p => (bool) p.Cells["CHK"].Value).ToList();
- if (checkRows.Any(p => p.Cells["BASENAME"].Value.ToString2() == ""))
- {
- MessageBox.Show("请选择工序点");
- return;
- }
- _gxs =
- checkRows.Select(p => p.Cells["BASENAME"].Value.ToString2())
- .Aggregate((a, b) => (a == "" ? "" : a + ";") + b);
- _gxNames =
- checkRows.Select(p => p.Cells["BASENAME"].Text.ToString2())
- .Aggregate((a, b) => (a == "" ? "" : a + ";") + b);
- this.DialogResult = DialogResult.OK;
- }
- private void FrmSetPlineGx_Load(object sender, EventArgs e)
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpDownLineManage.doQuery", new object[] { "7013" }, ob);
- kreason.DataSource = dt;
- kreason.DisplayMember = "BASENAME";
- kreason.ValueMember = "BASECODE";
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- if(e.Cell.Column.Key!="CHK")
- e.Cell.Row.Cells["CHK"].Value = true;
- }
-
- }
- }
|