| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- 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 CoreFS.CA06;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using Infragistics.Win.UltraWinGrid;
- using Core.StlMes.Client.Mcp.Mch.Entity;
- using com.steering.mes.mcp.entity;
- using Core.Mes.Client.Comm.Server;
- using Core.StlMes.Client.Mcp.Control;
- namespace Core.StlMes.Client.Mcp.Mch.MchResult
- {
- public partial class FrmOfficeD : FrmBase
- {
- UltraGridRow uge = null;
- string gx = "";
- public FrmOfficeD()
- {
- InitializeComponent();
- }
- public FrmOfficeD(OpeBase ob, UltraGridRow ugr,string GX)
- {
- InitializeComponent();
- this.ob = ob;
- uge = ugr;
- gx = GX;
- }
- //public override void ToolBar_Click(object sender, string ToolbarKey)
- //{
- // switch (ToolbarKey)
- // {
- // case "doQuery":
- // get_PurUoms();
- // break;
- // case "doAdd":
- // add_PurUoms();
- // break;
- // //case "doModify":
- // // upd_PurUoms();
- // // break;
- // case "doDelete":
- // del_PurUoms();
- // break;
- // case "Close":
- // this.Close();
- // break;
- // }
- //}
- /// <summary>
- /// 查询离线去向
- /// </summary>
- /// <param name="configureMEntity"></param>
- public void Query()
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmOfficeD.doQuery", new object[] { textheatNo.Text.Trim(), textPline.Text.Trim() }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- }
- /// <summary>
- /// 增加离线去向
- ///// </summary>
- ///// <param name="configureMEntity"></param>
- public void Add()
- {
- string heatno = "";
- string lotno = "";
- string pline = "";
- string process = "";
- string officed = "";
- if (txtheatno.Text != "" && txtheatno.Text != null)
- {
- heatno = txtheatno.Text;
- }
- else
- {
- MessageUtil.ShowTips("请输入炉号!");
- return;
- }
- if (txtlotno.Text != "" && txtlotno.Text != null)
- {
- lotno = txtlotno.Text;
- }
- else
- {
- MessageUtil.ShowTips("请输入批号!");
- return;
- }
- if (txtpline.Text != "" && txtpline.Text != null)
- {
- pline = txtpline.Text;
- }
- else
- {
- MessageUtil.ShowTips("请输入生产产线!");
- return;
- }
- if (txtprocess.Text != "" && txtprocess.Text != null)
- {
- process = txtprocess.Text;
- }
- else
- {
- MessageUtil.ShowTips("请输入工序!");
- return;
- }
- if (txtdirect.Text != "" && txtdirect.Text != null)
- {
- officed = txtdirect.Text;
- }
- else
- {
- MessageUtil.ShowTips("请输入离线去向!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Mch.FrmOfficeD";
- ccp.MethodName = "addOfficeD";
- ccp.ServerParams = new Object[] { heatno, lotno, pline, process, officed };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("新增成功!"))
- {
- Query();
- }
- }
- //ConfigureClassCommon.doActiveSelRow(ultraGrid1, "UomCode", UomsEntity.UomCode);//激活当前行
- }
- /////// <summary>
- /////// 修改离线去向
- /////// </summary>
- /////// <param name="configureMEntity"></param>
- //public void upd_PurUoms()
- //{
- // UltraGridRow urg = ultraGrid1.ActiveRow;
- // FrmMchPersonentity result = new FrmMchPersonentity();
- // result.Name = urg.Cells["NAME"].Value.ToString();
- // result.PlineCode = txt_pline.Text;
- // result.ProBc = txt_banci.Text;
- // CoreClientParam ccp = new CoreClientParam();
- // ccp.ServerName = "com.steering.mes.mcp.Mch.FrmMchPerson";
- // ccp.MethodName = "updatePerson";
- // ccp.ServerParams = new Object[] { result, txtheatno.Text };
- // ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- // if (ccp.ReturnCode != -1)
- // {
- // MessageUtil.ShowTips(ccp.ReturnInfo);
- // if (ccp.ReturnInfo.Equals("修改成功!"))
- // {
- // get_PurUoms();
- // }
- // }
- //}
- private void FrmOfficeD_Load(object sender, EventArgs e)
- {
- if (uge == null)
- {
- return;
- }
- else
- {
- init();
- }
-
- //产线
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmMchPerson.doQuerypline", null, this.ob);//如果是“”里面添加的是条件
- //pline.DataSource = dt;
- //pline.DisplayMember = "PLINE_NAME";
- //pline.ValueMember = "PLINE_CODE";
- //YdmBaseClass.SetComboItemHeight(pline);
- //txt_pline.DataSource = dt;
- //txt_pline.DisplayMember = "PLINE_NAME";
- //txt_pline.ValueMember = "PLINE_CODE";
- //YdmBaseClass.SetComboItemHeight(txt_pline);
- }
- //界面初始化
- private void init()
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- String heatplanno = uge.Cells["HEAT_PLAN_NO"].Value.ToString();
- String lotno = uge.Cells["LAST_BATCH_NO"].Value.ToString();
- String plinename = uge.Cells["PLINE_NAME"].Value.ToString();
- txtheatno.Value = heatplanno.Trim().ToString();
- txtlotno.Value = lotno.Trim().ToString();
- txtprocess.Value = gx.Trim().ToString();
- txtpline.Value = plinename.Trim().ToString();
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("加载数据失败:" + ex.Message);
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- ///// <summary>
- ///// 删除离线去向
- ///// </summary>
- ///// <param name="configureMEntity"></param>
- public void Delete()
- {
- if (ultraGrid1.ActiveRow != null)
- {
- UltraGridRow urg = ultraGrid1.ActiveRow;
- if (urg != null)
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Mch.FrmOfficeD";
- ccp.MethodName = "deletePerson";
- ccp.ServerParams = new Object[] { urg.Cells["OFFICE_D"].Value.ToString() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- Query();
- }
- }
- }
- else
- {
- MessageUtil.ShowTips("请选择一条数据");
- return;
- }
- }
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key.ToString())
- {
- case "Query":
- Query();
- break;
- case "Add":
- Add();
- break;
- case "Delete":
- Delete();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- }
- }
|