| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
-
- 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.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.ZGMil.Signature
- {
- public partial class FrmCancelAll : FrmBase
- {
- public FrmCancelAll()
- {
- InitializeComponent();
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQueryOutList();
- break;
- case "Cancel":
- cancelData();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询发运记录
- /// </summary>
- private void doQueryOutList()
- {
- string jugeNo = "";
- if (this.txtJugeNo.Text.Trim() == "")
- {
- MessageUtil.ShowTips("请输入判定炉号");
- return;
- }
- else
- {
- jugeNo = this.txtJugeNo.Text.Trim();
- }
- List<YdmZcOutlistEntity> listSource = EntityHelper.GetData<YdmZcOutlistEntity>(
- "com.steering.mes.signature.FrmCancelAll.doQueryOutList", new object[] { jugeNo }, this.ob);
- YdmZcOutlistbindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 撤销发运
- /// </summary>
- private void cancelData()
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null)
- {
- return;
- }
- YdmZcOutlistEntity ydmZcEntity = (YdmZcOutlistEntity)uRow.ListObject;
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmCancelAll.doQueryJugde", new object[] { ydmZcEntity.JudgeStoveNo.ToString() }, ob);
- if (int.Parse(ds.Rows[0][0].ToString()) > 0)
- {
- MessageUtil.ShowTips("该炉已经申请判定,不允许撤销!");
- return;
- }
- //DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmCancelAll.doQueryInstoreRs", new object[] { ydmZcEntity.JudgeStoveNo.ToString() }, ob);
- //if (dd.Rows[0][0].ToString() == "0")
- //{
- // MessageUtil.ShowTips("该炉在交库点未结炉,不允许撤销!");
- // return;
- //}
- string ydmTity = JSONFormat.Format(ydmZcEntity);
- if (MessageUtil.ShowYesNoAndQuestion("是否确认一键撤销?") == DialogResult.No) return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmCancelAll";
- ccp.MethodName = "cancelAll";
- ccp.ServerParams = new object[] { ydmTity,UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- doQueryOutList();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private void FrmCancelAll_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<YdmZcOutlistEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- }
- }
- }
|