| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
- using Core.StlMes.Client.PlnSaleOrd.工序排产.entity;
- using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
- using Core.StlMes.Client.PlnSaleOrd.炉计划.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 FrmSpitPlanJg : FrmBase
- {
- private string proPlanId = "";
- private string gxPlanNo = "";
- private OpeBase ob;
- public FrmSpitPlanJg(string _proPlanId, string _gxPlanNo, OpeBase _ob)
- {
- proPlanId = _proPlanId;
- gxPlanNo = _gxPlanNo;
- ob = _ob;
- InitializeComponent();
- }
- private string heatPlanNo = "";
- /// <summary>
- /// 炉计划ID
- /// </summary>
- public string HeatPlanNo
- {
- get { return heatPlanNo; }
- set { heatPlanNo = value; }
- }
- private string judgeStoveNo = "";
- /// <summary>
- /// 上料炉号
- /// </summary>
- public string JudgeStoveNo
- {
- get { return judgeStoveNo; }
- set { judgeStoveNo = value; }
- }
- private double reducedWtKc = 0;
- /// <summary>
- /// 折算吨
- /// </summary>
- public double ReducedWtKc
- {
- get { return reducedWtKc; }
- set { reducedWtKc = value; }
- }
- private double reducedWt = 0;
- /// <summary>
- /// 折算吨
- /// </summary>
- public double ReducedWt
- {
- get { return reducedWt; }
- set { reducedWt = value; }
- }
- private ArrayList list = null;
- public ArrayList List
- {
- get { return list; }
- set { list = value; }
- }
- private void FrmSpitPlanJg_Load(object sender, EventArgs e)
- {
- //订单排产
- EntityHelper.ShowGridCaption<PlnZyJgMEntity>(ultraGridZy.DisplayLayout.Bands[0]);
- BaseHelper.setUltraGridColumnMaxInput(ultraGridZy, new string[] { "PlanBlWt" });
- BaseHelper.setUltraGridColumnBits(ultraGridZy, new string[] { "PlanBlNum", "PlanJgNum" });
- BaseHelper.InitCellPosition(ultraGridZy, new string[] { "GxProSeq", "GxPlanNo", "PlanBlWt", "PlanBlNum", "PlanJgNum", "CraftSeq" });
- BaseHelper.GridColumnSum(ultraGridZy, new string[] { "PlanBlWt" });
- BaseHelper.GridColumnCount(ultraGridZy, new string[] { "PlanJgNum", "PlanBlNum" });
- StoveHelper.ForbidSort(ultraGridZy);
- DoQuery();
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "Query": //刷新
- DoQuery();
- break;
- case "Confirm": // 确认
- DoConfirm();
- break;
- case "Close": // 关闭
- this.Close();
- break;
- default:
- break;
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void DoQuery()
- {
- List<PlnZyJgMEntity> listSourceM = EntityHelper.GetData<PlnZyJgMEntity>
- ("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryStarM", new object[] { proPlanId, gxPlanNo, "H" }, ob);
- plnZyJgMEntityBindingSource.DataSource = listSourceM;
- foreach (UltraGridRow urg in ultraGridZy.Rows)
- {
- if (!urg.Cells["Planstatus"].Value.ToString().Equals("计划"))
- {
- urg.Cells["CHC"].Value = true;
- }
- }
- }
- /// <summary>
- /// 确认
- /// </summary>
- private void DoConfirm()
- {
- UltraGridRow row = ultraGridZy.ActiveRow;
- if (row == null) return;
- int count = 0;
- string planstrat="";
- foreach (UltraGridRow urg in ultraGridZy.Rows)
- {
- ArrayList list1 = new ArrayList();
- if (Convert.ToBoolean(urg.Cells["CHC"].Text) == true)
- {
- count++;
- //if (planstrat.Equals(""))
- //{
- // planstrat = urg.Cells["Planstatus"].Value.ToString();
- //}
- //if (!planstrat.Equals(urg.Cells["Planstatus"].Value.ToString()))
- //{
- // MessageUtil.ShowTips("请选择同一状态的炉号!");
- // return;
- //}
- //ReducedWt += double.Parse(urg.Cells["PlnOutsingleW"].Value.ToString());
- if (JudgeStoveNo.Equals(""))
- {
- JudgeStoveNo = urg.Cells["JudgeStoveNo"].Value.ToString();
- }
- else
- {
- JudgeStoveNo = JudgeStoveNo + "," + urg.Cells["JudgeStoveNo"].Value.ToString();
- }
- }
- else
- {
- //ReducedWtKc += double.Parse(urg.Cells["PlanBlWt"].Value.ToString());
- if (!urg.Cells["Planstatus"].Value.ToString().Equals("计划") && !urg.Cells["Planstatus"].Value.ToString().Equals("下发"))
- {
- MessageUtil.ShowTips("炉计划状态不是计划或下发中的必须勾选!");
- return;
- }
- if (HeatPlanNo.Equals(""))
- {
- HeatPlanNo = urg.Cells["HeatPlanNo"].Value.ToString();
- }
- else
- {
- HeatPlanNo = HeatPlanNo + "," + urg.Cells["HeatPlanNo"].Value.ToString();
- }
- }
-
- }
- //if (count == 0)
- //{
- // MessageUtil.ShowTips("请选择需拆分上料炉号!");
- // return;
- //}
- this.Close();
- }
- }
- }
|