| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm.Server;
- using CoreFS.CA06;
- using System.Collections;
- using Core.Mes.Client.Comm.Control;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Tool;
- namespace Core.StlMes.Client.Mcp.Coupling
- {
- public partial class FrmConfiguration : FrmBase
- {
- public FrmConfiguration()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private void FrmConfiguration_Load(object sender, EventArgs e)
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmConfiguration.getQueryPline", null, this.ob);
- cmbCx.DataSource = dt;
- cmbCx.DisplayMember = "PLINE_NAME";
- cmbCx.ValueMember = "PLINE_CODE";
- cmbCname.DataSource = dt;
- cmbCname.DisplayMember = "PLINE_NAME";
- cmbCname.ValueMember = "PLINE_CODE";
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "DoQuery":
- DoQuery();
- break;
- case "DoSave":
- DoSave();
- break;
- case "DoUpdate":
- DoUpdate();
- break;
- case "DoDelete":
- DoDelete();
- break;
- case "DoClose":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void DoQuery()
- {
- string testName = txtJcxm.Text.ToString();
- string plineName = "";
- if (cmbCname.SelectedIndex == -1) { plineName = ""; }
- else
- {
- plineName = cmbCname.Value.ToString();
- }
- ArrayList list = new ArrayList();
- list.Add(testName);
- list.Add(plineName);
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmConfiguration.getQueryPhosphateItem", new object[] { list }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- }
- /// <summary>
- /// 新增
- /// </summary>
- private void DoSave()
- {
- ultraGrid1.UpdateData();
- int AddCount = 0;
- ArrayList list1 = new ArrayList();
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Text) == true)
- {
- AddCount += 1;
- ArrayList list = new ArrayList();
- //list.Add(ugr.Cells["ITEM_NO"].Text.ToString());
- list.Add(ugr.Cells["PLINE_CODE"].Value.ToString());
- list.Add(ugr.Cells["PROCEDUR_NO"].Text.ToString());
- list.Add(ugr.Cells["TEST_ITEMS"].Text.ToString());
- list.Add(ugr.Cells["SPAN"].Text.ToString());
- list.Add(ugr.Cells["SETTING_TEMPERATURE"].Text.ToString());
- list1.Add(list);
- }
- }
- if (AddCount == 0) { MessageUtil.ShowTips("请选择数据!"); return; }
- if (MessageUtil.ShowYesNoAndQuestion("是否新增磷化检测项目?") == DialogResult.No) { return; }
- int count = ServerHelper.SetData("com.steering.mes.mcp.coup.FrmConfiguration.getAddPhosphateItem", new object[] { list1 }, this.ob);
- if (count == 1)
- {
- MessageUtil.ShowTips("保存成功!");
- DoQuery();
- }
- else { MessageUtil.ShowTips("保存失败!"); }
- }
- /// <summary>
- /// 修改
- /// </summary>
- private void DoUpdate()
- {
- ultraGrid1.UpdateData();
- int updateCount = 0;
- ArrayList list1 = new ArrayList();
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Text) == true)
- {
- updateCount += 1;
- ArrayList list = new ArrayList();
- list.Add(ugr.Cells["PLINE_CODE"].Value.ToString());
- list.Add(ugr.Cells["PROCEDUR_NO"].Text.ToString());
- list.Add(ugr.Cells["TEST_ITEMS"].Text.ToString());
- list.Add(ugr.Cells["SPAN"].Text.ToString());
- list.Add(ugr.Cells["SETTING_TEMPERATURE"].Text.ToString());
- list.Add(ugr.Cells["ITEM_NO"].Text.ToString());
- list1.Add(list);
- }
- }
- if (updateCount == 0) { MessageUtil.ShowTips("请选择数据!"); return; }
- if (MessageUtil.ShowYesNoAndQuestion("是否修改磷化检测项目?") == DialogResult.No) { return; }
- int count = ServerHelper.SetData("com.steering.mes.mcp.coup.FrmConfiguration.getUpdatePhosphateItem", new object[] { list1 }, this.ob);
- if (count == 1)
- {
- MessageUtil.ShowTips("修改成功!");
- DoQuery();
- }
- else { MessageUtil.ShowTips("修改失败!"); }
- }
- /// <summary>
- /// 删除
- /// </summary>
- private void DoDelete()
- {
- ultraGrid1.UpdateData();
- int updateCount = 0;
- ArrayList list1 = new ArrayList();
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Text) == true)
- {
- updateCount += 1;
- ArrayList list = new ArrayList();
- list.Add(ugr.Cells["ITEM_NO"].Text.ToString());
- list1.Add(list);
- }
- }
- if (updateCount == 0) { MessageUtil.ShowTips("请选择数据!"); return; }
- if (MessageUtil.ShowYesNoAndQuestion("是否删除磷化检测项目?") == DialogResult.No) { return; }
- int count = ServerHelper.SetData("com.steering.mes.mcp.coup.FrmConfiguration.getDeletePhosphateItem", new object[] { list1 }, this.ob);
- if (count == 1)
- {
- MessageUtil.ShowTips("删除成功!");
- DoQuery();
- }
- else { MessageUtil.ShowTips("删除失败!"); }
- }
- }
- }
|