| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- 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.PlnSaleOrd
- {
- public partial class FrmApplyRoval : FrmBase
- {
- public FrmApplyRoval()
- {
- InitializeComponent();
- }
- private void FrmApplyRoval_Load(object sender, EventArgs e)
- {
- DateTime now = DateTime.Now;
- DateTime d1 = new DateTime(now.Year, now.Month, 1);
- DateTime d2 = d1.AddMonths(1).AddSeconds(-1);
- txtStratTime.Value = d1;
- txtEndTime.Value = d2;
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "Query"://查询
- Query();
- break;
- case "AppThrough"://审批通过
- AppThrough();
- break;
- case "AppNotThrough"://审批不通过
- AppNotThrough();
- break;
- case "CancelThrough"://取消审批
- CancelThrough();
- break;
- case"Export":
- exportData();
- break;
- case "Close": //关闭
- this.Close();
- break;
- default:
- break;
- }
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void exportData()
- {
- GridHelper.ulGridToExcel(ultraGrid1, "合同推荐长度审批汇总");
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void Query()
- {
- string orderNo = "";
- string strat = "";
- string startTime = "";
- string endTime = "";
- if (chcOrderNo.Checked)
- {
- if (txtOrderNo.Text.Equals(""))
- {
- MessageUtil.ShowTips("请输入合同号!");
- return;
- }
- else
- {
- orderNo = txtOrderNo.Text.ToString().Trim();
- }
- }
- if (chcStrat.Checked)
- {
- strat = comStrat.Value.ToString();
- }
- if (chcTime.Checked)
- {
- startTime = txtStratTime.Value.ToString();
- endTime = txtEndTime.Value.ToString();
- }
- string supp = this.CustomInfo.Contains("120504") ? "120504" : "";
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.order.FrmApplyRoval.queryApplyNo", new object[] { orderNo, strat, startTime, endTime, this.ValidDataPurviewIds, this.UserInfo.GetUserName(), supp }, this.ob);
- GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
- }
- /// <summary>
- /// 审批通过
- /// </summary>
- private void AppThrough()
- {
- ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> chcRows = ultraGrid1.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True");
- if (chcRows == null || chcRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择申请单!");
- return;
- }
- ArrayList List = new ArrayList();
- foreach (UltraGridRow urow in chcRows)
- {
- ArrayList jsonList = new ArrayList();
- jsonList.Add(urow.Cells["APPLY_NO"].Value.ToString());
- jsonList.Add(urow.Cells["ORD_LN_PK"].Value.ToString());
- jsonList.Add(urow.Cells["ORD_LN_DLY_PK"].Value.ToString());
- jsonList.Add(urow.Cells["LENGTH_MIN_N"].Value.ToString());
- jsonList.Add(urow.Cells["LENGTH_MAX_N"].Value.ToString());
- jsonList.Add(urow.Cells["LENGTHDISC_N"].Text.ToString());
- jsonList.Add(urow.Cells["SHRT_STOVE_N"].Text.ToString());
- jsonList.Add(urow.Cells["ORDER_NO"].Value.ToString());
- jsonList.Add(urow.Cells["ORDER_SEQ"].Value.ToString());
- jsonList.Add(urow.Cells["DELIVERY_NO"].Value.ToString());
- jsonList.Add(urow.Cells["ISSUED_MEMO"].Text.ToString().Trim());
- jsonList.Add(urow.Cells["LEN_NO_N"].Text.ToString());
- List.Add(jsonList);
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否审批通过?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.order.FrmApplyRoval";
- ccp.MethodName = "appThrough";
- ccp.ServerParams = new object[] { List,this.UserInfo.GetUserName() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("审批通过成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 审批不通过
- /// </summary>
- private void AppNotThrough()
- {
- ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> chcRows = ultraGrid1.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True");
- if (chcRows == null || chcRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择申请单!");
- return;
- }
- ArrayList List = new ArrayList();
- foreach (UltraGridRow urow in chcRows)
- {
- ArrayList jsonList = new ArrayList();
- jsonList.Add(urow.Cells["APPLY_NO"].Value.ToString());
- jsonList.Add(urow.Cells["ORD_LN_PK"].Value.ToString());
- jsonList.Add(urow.Cells["ORD_LN_DLY_PK"].Value.ToString());
- jsonList.Add(urow.Cells["LENGTH_MIN_N"].Value.ToString());
- jsonList.Add(urow.Cells["LENGTH_MAX_N"].Value.ToString());
- jsonList.Add(urow.Cells["LENGTHDISC_N"].Text.ToString());
- jsonList.Add(urow.Cells["SHRT_STOVE_N"].Text.ToString());
- jsonList.Add(urow.Cells["ORDER_NO"].Value.ToString());
- jsonList.Add(urow.Cells["ORDER_SEQ"].Value.ToString());
- jsonList.Add(urow.Cells["DELIVERY_NO"].Value.ToString());
- jsonList.Add(urow.Cells["ISSUED_MEMO"].Text.ToString().Trim());
- jsonList.Add(urow.Cells["LEN_NO_N"].Text.ToString());
- List.Add(jsonList);
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否审批不通过?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.order.FrmApplyRoval";
- ccp.MethodName = "appNotThrough";
- ccp.ServerParams = new object[] { List,this.UserInfo.GetUserName() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("审批不通过成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 撤销审批
- /// </summary>
- private void CancelThrough()
- {
- ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> chcRows = ultraGrid1.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True");
- if (chcRows == null || chcRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择申请单!");
- return;
- }
- ArrayList List = new ArrayList();
- foreach (UltraGridRow urow in chcRows)
- {
- ArrayList jsonList = new ArrayList();
- jsonList.Add(urow.Cells["APPLY_NO"].Value.ToString());
- jsonList.Add(urow.Cells["ORD_LN_PK"].Value.ToString());
- jsonList.Add(urow.Cells["ORD_LN_DLY_PK"].Value.ToString());
- jsonList.Add(urow.Cells["LENGTH_MIN_N"].Value.ToString());
- jsonList.Add(urow.Cells["LENGTH_MAX_N"].Value.ToString());
- jsonList.Add(urow.Cells["LENGTHDISC_N"].Text.ToString());
- jsonList.Add(urow.Cells["SHRT_STOVE_N"].Text.ToString());
- jsonList.Add(urow.Cells["ORDER_NO"].Value.ToString());
- jsonList.Add(urow.Cells["ORDER_SEQ"].Value.ToString());
- jsonList.Add(urow.Cells["DELIVERY_NO"].Value.ToString());
- jsonList.Add(urow.Cells["ISSUED_MEMO"].Text.ToString().Trim());
- jsonList.Add(urow.Cells["LEN_NO_N"].Text.ToString());
- List.Add(jsonList);
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否撤销审批?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.order.FrmApplyRoval";
- ccp.MethodName = "cancelThrough";
- ccp.ServerParams = new object[] { List, this.UserInfo.GetUserName() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销审批成功!"))
- {
- Query();
- }
- }
- private void chcOrderNo_CheckedChanged(object sender, EventArgs e)
- {
- if (chcOrderNo.Checked) { txtOrderNo.Enabled = true; } else { txtOrderNo.Enabled = false; }
- if (chcStrat.Checked) { comStrat.Enabled = true; } else { comStrat.Enabled = false; }
- if (chcTime.Checked) { txtStratTime.Enabled = true; txtEndTime.Enabled = true; } else { txtStratTime.Enabled = false; txtEndTime.Enabled = false; }
- }
-
- }
- }
|