| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- using System;
- 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;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.YdmBcPipeManage.Entity;
- using CoreFS.CA06;
- namespace Core.StlMes.Client.YdmBcPipeManage.Demand
- {
- public partial class frmDemandSplit : FrmBase
- {
- private readonly TmsDemandM tmsDemandMs;
- private string startnode = "";
- private string endnode = "";
- public frmDemandSplit(OpeBase _ob, TmsDemandM tmsDemand,List<MatBcMatS> data )
- {
- InitializeComponent();
- lblUnplnQty.Text = tmsDemand.UnPlanQtyVal.ToString3();
- lblUnplnWt.Text = tmsDemand.UnPlanWtVal.ToString3();
- this.ob = _ob;
- tmsDemandMs = tmsDemand;
- uneNumber.Value = tmsDemand.UnPlanQtyVal;
- EntityHelper.ShowGridCaption<MatBcMatS>(ultraGrid1.DisplayLayout.Bands[0]);
- data.ForEach(p=>p.chk= p.PlineName!= tmsDemand.DemandOrgDesc && p.QcmStaus =="合格" &&
- ( tmsDemand.TranClassCode!="TL" || p.StorageName!= tmsDemandMs.EndAreaDesc)
- );
-
- matBcMatSBindingSource.DataSource = data;
- ultraGrid1_CellChange(null, null);
- GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "Memo");
-
- }
-
- private void ubtSave_Click(object sender, EventArgs e)
- {
- int splitNum = 0;
- if (uneNumber.Value == null || !int.TryParse(uneNumber.Value.ToString3(), out splitNum) || splitNum<=0)
- {
- MessageBox.Show("请输入正确的拆分支数");
- return;
- }
-
-
- var ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.Demand.sever.TmsDemandServer";
- ccp.MethodName = "splitDemand";
- ccp.ServerParams = new object[]
- {
- tmsDemandMs.DemandNo,
- splitNum,
- UserInfo.GetUserName()
- };
- ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("拆分成功!"))
- this.DialogResult = DialogResult.OK;
- else
- {
- uneNumber.Focus();
- uneNumber.SelectAll();
- }
- }
-
- }
- private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- ultraGrid1.UpdateData();
- try
- {
- uneNumber.Value =
- (matBcMatSBindingSource.DataSource as List<MatBcMatS>).Where(p => p.chk).Sum(p => p.ActCount);
- }
- catch (Exception)
- {
-
- }
- }
- }
- }
|