| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.LgResMgt.Mcms.entity;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinEditors;
- using Infragistics.Win.UltraWinToolbars;
- namespace Core.StlMes.Client.LgResMgt.Mcms
- {
- public partial class BlankPredictionSelect2 : FrmBase
- {
- private List<CmmBlankPredictionEntityEdit> totals;
- private List<CmmWeightMatEntity> defaultList;
- private List<CmmBlankPredictionEntityEdit> currentTotal;
- public BlankPredictionSelect2(OpeBase _ob,CmmWeightRecordEntityFull defaultData)
- {
- InitializeComponent();
- ob = _ob;
- EntityHelper.ShowGridCaption<CmmBlankPredictionEntityEdit>(CrackDetectGrid.DisplayLayout.Bands[0]);
- totals = EntityHelper.GetData<CmmBlankPredictionEntityEdit>(
- "com.steering.Mcms.BlankPredictionServer.doQuery",
- new object[] { new Dictionary<string, object> { { "validflag", new List<string> { "1" } } } },
- ob);
- if (totals.Any())
- {
- totals = totals.OrderBy(p => p.ShippersName).ThenBy(p => p.OrderNo).ThenBy(p => p.JudgeStoveNo).ToList();
- }
- uceQueryShipperName.DataSource = totals.Select(p => p.ShippersName).Distinct().ToList();
- if (defaultData != null)
- {
- defaultList = defaultData.MatInfos;
-
- uceQueryShipperName.Text = defaultData.ShippersName;
- }
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
-
- }
- private void CrackDetectGrid_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- if (e.Cell.Column.Key != "Chk")
- {
- e.Cell.Row.Cells["Chk"].Value = true;
- e.Cell.Row.Cells["Chk"].Appearance.BackColor = Color.LightGreen;
- }
- else
- {
- CrackDetectGrid.UpdateData();
- if(!(bool)e.Cell.Row.Cells["Chk"].Value) e.Cell.Row.Cells["Chk"].Appearance.Reset();
- }
- }
- private void uceQueryShipperName_ValueChanged(object sender, System.EventArgs e)
- {
- cmmBlankPredictionEntityBindingSource.Clear();
- txtJudgeStove.Text = "";
- if (uceQueryShipperName.Text != "")
- {
- currentTotal =
- totals.Where(p => p.ShippersName == uceQueryShipperName.Text)
- .ToList();
- if (defaultList != null)
- {
- currentTotal.Where(p => defaultList.Any(q => q.DocumentNo == p.PredictionId)).ToList().ForEach(p =>
- {
- p.Chk = true;
- p.EditNum = defaultList.FirstOrDefault(q => q.DocumentNo == p.PredictionId).ActCount;
- });
- defaultList = null;
- }
- cmmBlankPredictionEntityBindingSource.DataSource = currentTotal;
- }
-
- }
- public string ShipperName { get;private set; }
- public List<CmmBlankPredictionEntityEdit> List { get;private set; }
- private void utnOk_Click(object sender, System.EventArgs e)
- {
- ShipperName = uceQueryShipperName.Text;
-
- CrackDetectGrid.UpdateData();
- if (currentTotal != null)
- {
- List = currentTotal.Where(p => p.Chk).ToList();
- }
- this.DialogResult = DialogResult.OK;
- }
- private void BlankPredictionSelect_Shown(object sender, EventArgs e)
- {
- this.Font = new Font("宋体", 12F);
- CrackDetectGrid.DisplayLayout.Override.HeaderAppearance.FontData.SizeInPoints =12;
- CrackDetectGrid.Font = Font;
- }
- private void txtJudgeStove_KeyUp(object sender, KeyEventArgs e)
- {
- if (currentTotal == null) return;
- cmmBlankPredictionEntityBindingSource.DataSource = string.IsNullOrWhiteSpace(txtJudgeStove.Text.Trim()) ? currentTotal :
- currentTotal.Where(p => p.JudgeStoveNo.IndexOf(txtJudgeStove.Text.Trim(), StringComparison.Ordinal) >= 0).ToList();
- cmmBlankPredictionEntityBindingSource.ResetBindings(false);
- }
- private void CrackDetectGrid_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
- {
- if ((bool)e.Row.Cells["Chk"].Value) e.Row.Cells["Chk"].Appearance.BackColor = Color.LightGreen;
- }
- }
- }
|