| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- using Core.Mes.Client.Comm.Format;
- 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.Windows.Forms;
- namespace Core.StlMes.Client.ZGMil.Signature
- {
- public partial class FrmCancelOutList : FrmBase
- {
- public FrmCancelOutList()
- {
- InitializeComponent();
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- QueryXOut();
- break;
- case "cancelOutList":
- cancelOutList();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询待处理出库单记录
- /// </summary>
- private void QueryXOut()
- {
- string jugeNo = "";
- string outDoc = "";
- string plinCode = "";
- //string departMentId = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
- string departMentId = UserInfo.GetDeptid();
- NativeMethodNew na = new NativeMethodNew(this.ob);
- plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- if (this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
- {
- jugeNo = this.txtJugeNo.Text.Trim();
- }
- if (this.chkOutDoc.Checked && this.txtOutDoc.Text.Trim() != "")
- {
- }
- if (this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() == "")
- {
- MessageUtil.ShowTips("请输入判定炉号!");
- return;
- }
- if (this.chkOutDoc.Checked && this.txtOutDoc.Text.Trim() == "")
- {
- MessageUtil.ShowTips("请输入出库单号!");
- return;
- }
- List<YdmZcOutlistEntity> listSource = EntityHelper.GetData<YdmZcOutlistEntity>(
- "com.steering.mes.signature.FrmInOnlineStore.queryXOut", new object[] { jugeNo,outDoc,plinCode, departMentId }, this.ob);
- YdmZcOutlistEntitybindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 撤销待处理出库单
- /// </summary>
- private void cancelOutList()
- {
- this.ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要撤销的主信息!");
- return;
- }
- ArrayList parm = new ArrayList();
- foreach (UltraGridRow uRow in checkMagRows)
- {
- YdmZcOutlistEntity outListEnTity = (YdmZcOutlistEntity)uRow.ListObject;
- string outListTity = JSONFormat.Format(outListEnTity);
- parm.Add(outListTity);
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "cancelOutList";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- QueryXOut();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private void FrmCancelOutList_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<YdmZcOutlistEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- }
- private void chkOutDoc_CheckedChanged(object sender, EventArgs e)
- {
- this.txtOutDoc.Enabled = this.chkOutDoc.Checked;
- }
- private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked;
- }
- }
- }
|