| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- 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 com.steering.mes.mcp.entity;
- using Core.Mes.Client.Comm.Server;
- using Core.StlMes.Client.Mcp.Control;
- namespace Core.StlMes.Client.Mcp.Treatment
- {
- public partial class HttReason : FrmBase
- {
- UltraGridRow uge = null;
- string gx = "";
- public HttReason()
- {
- InitializeComponent();
- }
- public HttReason(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()
- {
- string startTim = "";
- string endTim = "";
- string heatid = "";
- string judgeno = "";
- if (chkTim.Checked)
- {
- if (DateTime.Parse(StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
- {
- MessageUtil.ShowTips("选择时间区间错误,请重新选择!");
- return;
- }
- else
- {
- startTim = this.StartTime.Value.ToString("yyyy-MM-dd 00:00:00");
- endTim = this.EndTime.Value.ToString("yyyy-MM-dd 23:59:59");
- }
- }
- if (!string.IsNullOrEmpty(planid.Text.Trim()))
- {
- heatid = planid.Text.ToString().Trim();
- }
- if(!string.IsNullOrEmpty(judgeNo.Text.Trim()))
- {
- judgeno = judgeNo.Text.ToString().Trim();
- }
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.heatTreatment.HttReason.doQuery", new object[] { startTim,endTim, heatid, judgeno }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- if(dt.Rows.Count<=0)
- {
- dataTable2.Clear();
- }
- }
- /// <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.FrmReason";
- // 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 FrmReason_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["BATCH_NO"].Value.ToString();
- String plinename = uge.Cells["PLINE_NAME"].Value.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.FrmReason";
- ccp.MethodName = "deletePerson";
- ccp.ServerParams = new Object[] { urg.Cells["FAIL_REASON"].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;
- }
- }
- private void ultraGrid4_AfterRowActivate(object sender, EventArgs e)
- {
- string heatno = "";
- UltraGridRow urg = ultraGrid4.ActiveRow;
- if(urg!=null)
- {
- heatno = urg.Cells["HEAT_PLAN_NO"].Value.ToString();
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.heatTreatment.HttReason.queryfail", new object[] { heatno }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
- }
- }
- }
- }
|