| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- 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.Treatment
- {
- public partial class FrmSetPlineOffice : FrmBase
- {
- public static ArrayList list = null;
- private string plinegx = "";
- private string plineCode = "";
- public string plinegxlist = "";
- //public string offlineplace = "";
- public string save = "0";
- private string Nation = "";
- public FrmSetPlineOffice()
- {
- InitializeComponent();
- }
- public FrmSetPlineOffice(String pline_Code,String nation, OpeBase ob)
- {
- InitializeComponent();
- this.ob = ob;
- plineCode = pline_Code;
- //offlineplace = offlinep;
- Nation = nation;
- }
- 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()
- {
- UltraGridRow urg = ultraGrid1.ActiveRow;
- if (urg != null)
- {
- if (Convert.ToBoolean(urg.Cells["CHK"].Text) == true && urg.Cells["BASENAME"].Text != "")
- {
- if (save == "0")
- {
- MessageUtil.ShowTips("请点保存按钮!");
- return;
- }
- }
- }
- this.Close();
- }
- /// <summary>
- /// 新增
- /// </summary>
- private void Save()
- {
- string gxn = "";
- int addCount = 0;
- ArrayList list1 = new ArrayList();
- foreach (UltraGridRow urg in ultraGrid1.Rows)
- {
- if(urg.Cells["CHK"].Text=="")
- {
- continue;
- }else if(Convert.ToBoolean(urg.Cells["CHK"].Text) == true)
- {
- addCount += 1;
- if(gxn=="")
- {
- gxn = urg.Cells["BASENAME"].Text.ToString();
- }
- else
- {
- gxn = gxn + ";" + urg.Cells["BASENAME"].Text.ToString();
- }
-
- //ArrayList pram = new ArrayList();
- //pram.Add(urg.Cells["BASENAME"].Text.ToString());
- list1.Add(urg.Cells["BASENAME"].Text.ToString());
- }
- }
- if(addCount==0)
- {
- MessageUtil.ShowTips("请选择要排序的工序点!");
- return;
- }
- list = list1;
- if (list.Count != 0)
- {
- MessageUtil.ShowTips("添加成功!");
- save = "1";
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- //CoreClientParam ccp = new CoreClientParam();
- //try
- //{
- // this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- // if (Constant.WaitingForm == null)
- // {
- // Constant.WaitingForm = new WaitingForm();
- // }
- // Constant.WaitingForm.ShowToUser = true;
- // Constant.WaitingForm.Show();
- // Constant.WaitingForm.Update();
- // ccp.ServerName = "com.steering.mes.mcp.Mch.FrmSetPline";
- // ccp.MethodName = "addPlineOffice";
- // ccp.ServerParams = new Object[] { list, plineCode,Nation };
- // ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- // this.Cursor = Cursors.Default;
- // Constant.WaitingForm.ShowToUser = false;
- // Constant.WaitingForm.Close();
- // Constant.WaitingForm = null;
- //}
- //catch (Exception ex)
- //{
- // this.Cursor = Cursors.Default;
- // Constant.WaitingForm.ShowToUser = false;
- // Constant.WaitingForm.Close();
- // Constant.WaitingForm = null;
- //}
- //if (ccp.ReturnCode != -1)
- //{
- // MessageUtil.ShowTips(ccp.ReturnInfo);
- // if (ccp.ReturnInfo.Equals("新增成功!"))
- // {
- // save = "1";
- // plinegxlist = gxn.ToString();
- // //scrapNum = scarpTotalNum.ToString();
- // this.DialogResult = System.Windows.Forms.DialogResult.OK;
- // }
- // else
- // {
- // MessageUtil.ShowTips(ccp.ReturnInfo);
- // }
- //}
-
- }
- public HttOfflineResultDentity getRowData(UltraGridRow checkrow)
- {
- HttOfflineResultDentity resultD = new HttOfflineResultDentity();
- resultD.GowhereName = checkrow.Cells["GOWHERE_NAME"].Value.ToString().Trim();
- resultD.OfflineNum = checkrow.Cells["OFFLINE_NUM"].Value.ToString().Trim();
- return resultD;
- }
- //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 FrmSetPlineGx_FormClosing(object sender, FormClosingEventArgs e)
- {
- UltraGridRow urg = ultraGrid1.ActiveRow;
- if (urg != null)
- {
- if (Convert.ToBoolean(urg.Cells["CHK"].Value) == true && urg.Cells["BASENAME"].Text != "")
- {
- if (save == "0")
- {
- MessageUtil.ShowTips("请点保存按钮!");
- e.Cancel = true;
- }
- }
- }
- }
- /// <summary>
- ///
- /// ulltragrid控件受勾影响(打钩可编辑,不打勾不能编辑)**
- /// </summary>
- /// <param name="row"></param>
- private void GridEdite(UltraGridRow row)
- {
- if (row.GetValue("CHK") == "True")
- {
- foreach (UltraGridCell cell in row.Cells)
- {
- if (cell.Column.CellActivation == Activation.AllowEdit)
- {
- cell.Activation = Activation.AllowEdit;
- }
- }
- }
- else
- {
- foreach (UltraGridCell cell in row.Cells)
- {
- if (cell.Column.Key.Contains("CHK")) continue;
- if (cell.Column.CellActivation == Activation.AllowEdit)
- {
- cell.Activation = Activation.ActivateOnly;
- }
- }
- }
- ultraGrid1.UpdateData();
- }
- private void ultraGrid1_AfterRowInsert(object sender, RowEventArgs e)
- {
- this.ultraGrid1.UpdateData();
- GridEdite(e.Row);
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid1.UpdateData();
- GridEdite(e.Cell.Row);
- }
- private void FrmSetPlineOffice_Load(object sender, EventArgs e)
- {
- foreach (UltraGridRow urg in ultraGrid1.Rows)
- {
- GridEdite(urg);
- }
- }
- }
- }
|