| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using com.steering.mes.mcp.entity;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control.Entity;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.StlMes.Client.Mcp.Control.Machining
- {
- public partial class InstructionCardControl : MchControlBase
- {
- public InstructionCardControl()
- {
- InitializeComponent();
- EntityHelper.ShowGridCaption<MchLoadingResultEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- gx = "701301";
- Value = null;
- }
- protected override void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- try
- {
- if (e.Cell.Column.Key.Equals("LoadTime"))
- {
- return;
- }
- ultraGrid1.UpdateData();
- if (e.Cell.Column.Key.Equals("ProNum"))
- {
- DataTable dt =
- ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmMcpLoading.getQueryWeight",
- new object[]
- {
- e.Cell.Value.ToString(),
- PlnZyJgxCEntity.FeedHeatNo,
- PlnZyJgxCEntity.BatchNo,
- PlnZyJgxCEntity.BatchGroudNo
-
- }, this.Ob);
- if (dt.Rows.Count > 0)
- {
- decimal weigt;
- decimal.TryParse(dt.Rows[0]["ACT_WEIGHT"].ToString(), out weigt);
- e.Cell.Row.Cells["ProWt"].Value = weigt;
- }
- }
- if (e.Cell.Column.Key.Equals("LoadGroup") && Value.LoadGroup != null)
- {
- name.DataSource = Names.Where(p => p.ColGroup == Value.LoadGroup).ToList();
- }
- ultraGrid1.Refresh();
- }
- catch (Exception ex)
- {
- }
- }
- public MchLoadingResultEntity Value
- {
- get
- {
- var list =
- mchLoadingResultEntityBindingSource.DataSource as List<MchLoadingResultEntity>;
- return (list == null) || !list.Any() ? new MchLoadingResultEntity() : list.FirstOrDefault();
- }
- set
- {
- if (value == null)
- {
- mchLoadingResultEntityBindingSource.DataSource = new List<MchLoadingResultEntity>
- {
- new MchLoadingResultEntity()
- };
- ScrappedList = new List<MchBugDEntity>();
- }
- else
- {
- mchLoadingResultEntityBindingSource.DataSource = new List<MchLoadingResultEntity> { value.Clone() };
- if ((ob == null) || (ob.MainUrl == "")) return;
- if (_plineCode != Value.PlineCode)
- {
- Names = EntityHelper.GetData<HttSignatureEntity>(
- "com.steering.mes.mcp.heatTreatment.FrmHttCrackDetectResult.getHttSign",
- new object[] { Value.PlineCode, "0" }, Ob);
-
- name.DisplayMember = "UserName";
- name.ValueMember = "UserName";
- YdmBaseClass.SetComboItemHeight(name);
- _plineCode = Value.PlineCode;
- }
-
- name.DataSource = Names.Where(p => p.ColGroup == value.LoadGroup).ToList();
- if (value.FailNum == 0)
- ScrappedList = new List<MchBugDEntity>();
- ultraGrid1.DisplayLayout.Bands[0].Columns["ProNum"].MaxValue = value.ProNum;
- }
- }
- }
- protected override void EditScrapped()
- {
- Value.FailNum = ScrappedList.Sum(p=>p.FailNum);
- Value.FailWt = ScrappedList.Sum(p => p.FailWt);
- ultraGrid1.Refresh();
- }
- }
- }
|