| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control;
- using Core.StlMes.Client.Mcp.Control.Common;
- using Core.StlMes.Client.Mcp.Control.Entity;
- using Core.StlMes.Client.Mcp.Control.Machining;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinEditors;
- using Infragistics.Win.UltraWinGrid;
- using System.Threading;
- using com.steering.mes.mcp.entity;
- using Infragistics.Win;
- using Core.StlMes.Client.Mcp.Mch.Entity;
- using Core.Mes.Client.Comm.Format;
- using System.Collections;
- namespace Core.StlMes.Client.Mcp.Mch
- {
- public partial class FrmMesureData : FrmBase
- {
- public FrmMesureData()
- {
- InitializeComponent();
- }
- private string _judgeStove = "";
- List<String> _ls = new List<String>();
- private string _batchNo = "";
- public List<RtdMeasurePosdataEntityZJ> list = new List<RtdMeasurePosdataEntityZJ>();
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- EntityHelper.ShowGridCaption<RtdMeasurePosdataEntityZJ>(ugData.DisplayLayout.Bands[0]);
- ugData.DisplayLayout.Override.AllowRowFiltering = DefaultableBoolean.False;
- ugData.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.Default;
- EntityHelper.ShowGridCaption<RtdMeasurePosdataEntityZJ>(ugData.DisplayLayout.Bands[0]);
- }
- public FrmMesureData(string judgeStoveNo, string batcjNo ,OpeBase _ob, string userName, bool ShowAdd, List<String> ls)
- {
- // _jgxPlan = JgxPlan;
- _judgeStove = judgeStoveNo;
- _batchNo = batcjNo;
- this.ob = _ob;
- _ls = ls;
- InitializeComponent();
- Query();
- }
- private void Query() {
- list = EntityHelper.GetData<RtdMeasurePosdataEntityZJ>(
- "com.steering.mes.mcp.Mch.FrmZjResult.geRtdMeasurePosdataAll",
- new object[] { _judgeStove, _batchNo},
- ob);
- for (int i = 0; i < list.Count; i++ )
- {
- for (int k = 0; k < _ls.Count; k++)
- {
- if (_ls[k].Equals(list[i].MatNo))
- {
- list[i].Check = true;
- }
- }
- }
- rtdMeasurePosdataEntityBindingSource.DataSource = list;
- var WasteList = list.Where(p => p.Flag == "10").ToList();
- string message = "共" + list.Where(p => p.Flag == "00").Select(p => p.MatNo).Distinct().Count() + "支";
- string messageW = " ";
- if (WasteList.Any())
- messageW = " 已剔除" + WasteList.Count + "条";
- ugData.DisplayLayout.Bands[0].Summaries[0].DisplayFormat = message;
- ugData.DisplayLayout.Bands[0].Summaries[1].DisplayFormat =
- list.Where(p => p.Flag == "00" && p.Rk == "1").Sum(p => p.ActLen).ToString3();
- ugData.DisplayLayout.Bands[0].Summaries[2].DisplayFormat =
- list.Where(p => p.Flag == "00" && p.Rk == "1").Sum(p => p.ActWeight).ToString3();
- ugData.DisplayLayout.Bands[0].Summaries["Waste"].DisplayFormat = messageW;
- }
- private void isCheked_Click(object sender, EventArgs e)
- {
- List<RtdMeasurePosdataEntityZJ> list = rtdMeasurePosdataEntityBindingSource.DataSource as List<RtdMeasurePosdataEntityZJ>;
- if (list == null) return;
- list = list.Where(p => p.Check).ToList();
- if (!list.Any()) { MessageUtil.ShowTips("请勾选要保存的数据!"); return; }
- if (MessageUtil.ShowYesNoAndQuestion("是否要保存?") == DialogResult.No)
- return;
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- ccp.ServerName = "com.steering.mes.mcp.Mch.FrmZjResult";
- ccp.MethodName = "addZjc";
- ccp.ServerParams = new Object[] { list.Select(JSONFormat.Format).ToList() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode != -1)
- {
- // MessageUtil.ShowTips(ccp.ReturnInfo);
- // query();
- this.Close();
- }
- }
- private void ultraButton1_Click(object sender, EventArgs e)
- {
- List<RtdMeasurePosdataEntityZJ> list = rtdMeasurePosdataEntityBindingSource.DataSource as List<RtdMeasurePosdataEntityZJ>;
- if (list == null) return;
- list = list.Where(p => p.Check).ToList();
- if (!list.Any()) { MessageUtil.ShowTips("请勾选要保存的数据!"); return; }
- if (MessageUtil.ShowYesNoAndQuestion("是否要取消?") == DialogResult.No)
- return;
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- ccp.ServerName = "com.steering.mes.mcp.Mch.FrmZjResult";
- ccp.MethodName = "DZjc";
- ccp.ServerParams = new Object[] { list.Select(JSONFormat.Format).ToList() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- this.Close();
- }
- }
- }
|