| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- using com.steering.mes.zgmil.entity;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.ZGMil.Entity;
- using CoreFS.CA06;
- 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.Text.RegularExpressions;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.ZGMil.Signature
- {
- public partial class FrmUpdatePlan : FrmBase
- {
- public FrmUpdatePlan()
- {
- InitializeComponent();
- }
- private void FrmUpdatePlan_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<MilPlanEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- queryMilPlan();
- break;
- case "updateStatus":
- updateSawNum();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询炉计划
- /// </summary>
- private void queryMilPlan()
- {
- string jugeNo = "";
- string lotNo = "";
- NativeMethodNew na = new NativeMethodNew(this.ob);
- string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- if (this.txtJugeNo.Text.Trim() == "")
- {
- MessageUtil.ShowTips("请输入炉号查询!");
- return;
- }
- else
- {
- jugeNo = this.txtJugeNo.Text.Trim();
- }
- if (this.chkLotNo.Checked && this.txtLotNo.Text.Trim() != "")
- {
- lotNo = this.txtLotNo.Text.Trim();
- }
- ArrayList list = new ArrayList();
- list.Add(jugeNo);
- list.Add(lotNo);
- list.Add(plinCode);
- List<MilPlanEntity> listSource = EntityHelper.GetData<MilPlanEntity>(
- "com.steering.mes.signature.FrmUpdatePlan.queryMilPlan", new object[] { list }, this.ob);
- MilPlanEntitybindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 修改倍尺数
- /// </summary>
- private void updateSawNum()
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要修改的炉信息!");
- return;
- }
- MilPlanEntity milPlanEntity = (MilPlanEntity)uRow.ListObject;
-
- if(!StringUtil.IsInt(milPlanEntity.SawNum.ToString2()))
- {
- MessageUtil.ShowTips("分切数必须为整数!");
- return;
- }
- if (int.Parse(milPlanEntity.SawNum.ToString2()) == 0)
- {
- MessageUtil.ShowTips("分切数必须大于零!");
- return;
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmUpdatePlan.doQuerySawResult", new object[] { milPlanEntity.Id.ToString(), milPlanEntity.JudgeStoveNo }, ob);
- if (int.Parse(ds.Rows[0][0].ToString()) > 0)
- {
- MessageUtil.ShowTips("已产生分切实绩,不允许进行分切数的修改!");
- return;
- }
- DataTable dp = ServerHelper.GetData("com.steering.mes.signature.FrmUpdatePlan.doQuerySamplePipe", new object[] { milPlanEntity.Id.ToString(), milPlanEntity.JudgeStoveNo }, ob);
- if (int.Parse(dp.Rows[0][0].ToString()) > 0)
- {
- MessageUtil.ShowTips("已分批取样,不允许进行分切数的修改!");
- return;
- }
- string milPlanTity = JSONFormat.Format(milPlanEntity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmUpdatePlan";
- ccp.MethodName = "updateSawNum";
- ccp.ServerParams = new object[] { milPlanTity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- AddRackJZ(milPlanEntity.JudgeStoveNo.ToString(), milPlanEntity.ProPlanId.ToString(), milPlanEntity.GxPlanNo.ToString());
- queryMilPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 修改了分切数,删除原来的精整跟踪记录,再新增精整跟踪记录
- /// </summary>
- /// <param name="jugeNo"></param>
- private void AddRackJZ(String jugeNo, String proPlanId, String gxPlanNo)
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.AddRackJZ", new object[] { jugeNo, plinCode, proPlanId, gxPlanNo }, this.ob);
- }
-
- }
- }
|