| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
-
- using System;
- using System.Linq;
- using System.Windows.Forms;
- using com.steering.mes.mcp.entity;
- using Core.Mes.Client.Comm.Format;
- 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.Mch.MchResult;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.StlMes.Client.Mcp.Mch
- {
- public partial class FrmBundingResult : FrmMchBase
- {
- public FrmBundingResult()
- {
- InitializeComponent();
- mchControlBase1 = new BundingControl()
- {
- Dock = DockStyle.Fill
- };
- plnEdit.Controls.Add(mchControlBase1);
- }
-
- protected override UltraGridRow ActitveResultRow { get { return CrackDetectGrid.ActiveRow; } }
- protected override object Value { get { return (mchControlBase1 as BundingControl).Value; } }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- EntityHelper.ShowGridCaption<MchBundlingResultEntity>(CrackDetectGrid.DisplayLayout.Bands[0]);
- base.ultraGrid1.DisplayLayout.Bands[0].Columns["ActCount"].Hidden = true;
- base.ultraGrid1.DisplayLayout.Bands[0].Columns["ActWeight"].Hidden = true;
- base.ultraGrid1.DisplayLayout.Bands[0].Columns["BatchGroudNo"].Hidden = true;
- CrackDetectGrid.DisplayLayout.Override.AllowRowFiltering = DefaultableBoolean.False;
- CrackDetectGrid.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.Default;
- ultraOptionSet2.Visible = false;
- var dt1 = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmBundingType.query",
- new object[] { }, ob);
- (mchControlBase1 as BundingControl).uceBundingType.DataSource = dt1;
- (mchControlBase1 as BundingControl).uceBundingType.DisplayMember = "BASE_NAME";
- (mchControlBase1 as BundingControl).uceBundingType.ValueMember = "BASE_CODE";
- }
- protected override void DoAdd()
- {
- if (ActiveRow != null)
- {
- if (MessageUtil.ShowYesNoAndQuestion("是否增加打捆实绩?") == DialogResult.No)
- return;
- var ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Mch.FrmBundingResult";
- ccp.MethodName = "DoAdd";
- ccp.ServerParams = new object[]
- {
- JSONFormat.Format(Value),
- Gx,
- mchControlBase1.ScrappedList.Select(JSONFormat.Format).ToList(),
- mchControlBase1.SuspiciousList.Select(JSONFormat.Format).ToList()
- };
- ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("新增成功!"))
- {
- Query();
- }
- }
- }
- }
- protected override void DoDelete()
- {
- {
- if (ActiveRow != null && ActitveResultRow != null)
- {
- if (MessageUtil.ShowYesNoAndQuestion("是否删除打捆实绩?") == DialogResult.No)
- return;
- var ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Mch.FrmBundingResult";
- ccp.MethodName = "DoDelete";
- ccp.ServerParams = new object[]
- {
- JSONFormat.Format(ActitveResultRow.ListObject), Gx
- };
- ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- Query();
- }
- }
- }
- }
- protected override void GetResultData()
- {
- base.GetResultData();
- MchBundlingResultEntityBindingSource.DataSource = EntityHelper.GetData<MchBundlingResultEntity>(
- "com.steering.mes.mcp.Mch.FrmBundingResult.getQueryExpandResult",
- new object[] { ActiveRow.HeatPlanNo, ActiveRow.BatchNo },
- ob);
- commHelper.RefreshAndAutoSize(CrackDetectGrid);
- if (ActiveRow == null) return;
- var BundingControl = mchControlBase1 as BundingControl;
- if(BundingControl==null) return;
- var result = new MchBundlingResultEntity
- {
- HeatPlanNo = ActiveRow.HeatPlanNo,
- JudgeStoveNo = ActiveRow.JudgeStoveNo,
- BatchNo = ActiveRow.BatchNo,
- PlineCode = ActiveRow.PlineCode,
- PlineName = ActiveRow.PlineName,
- ProNum = BundingControl.OkPort.Count > (ActiveRow.OperateCount ?? 0) ? BundingControl.OkPort.Count - (ActiveRow.OperateCount ?? 0) : 0,
- FailNum = 0,
- FailWt = 0,
- ProShift = UserInfo.GetUserOrder(),
- ProGroup = UserInfo.GetUserGroup(),
- ProUser = UserInfo.GetUserName(),
- ProTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
- };
- if (result.ProNum <= 0)
- {
- int OffNum = GetReturnNum();
- result.ProNum = BundingControl.OkPort.Count - (ActiveRow.OperateCount ?? 0)+ result.ProNum + OffNum;
- if (result.ProNum < 0)
- {
- result.ProNum = 0;
- }
- }
- BundingControl.Value = result;
- }
- }
-
-
-
- }
|