using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using CoreFS.CA06; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Control; using Core.StlMes.Client.ZGMil; using com.steering.mes.zgmil.entity; using Infragistics.Win.UltraWinGrid; namespace Core.StlMes.Client.ZGMil.ResultConrtrol { public partial class StraighteningResult : UserControl { private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null; public StraighteningResult() { InitializeComponent(); GridHelper.InitCardGrid(StraightDataSource2, ultraGrid2); _grid = this.ultraGrid2; } private MilStraighteningResultEntity _StraighPlan = new MilStraighteningResultEntity(); [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public MilStraighteningResultEntity Value { get { return _StraighPlan; } set { if (value != null) { _StraighPlan = value; UpdateData(); } } } private bool isCellSelect = false; public bool IsCellSelect { get { return isCellSelect; } set { isCellSelect = value; } } private void ultraGrid2_CellChange(object sender, CellEventArgs e) { this.IsCellSelect = true; } public void UpdateData() { if (_StraighPlan != null) { StraightDataSource2.Rows[0]["Remark"] = _StraighPlan.Remark; //上料支数 //StraightDataSource2.Rows[0]["OperatingTable"] = _StraighPlan.LotNo; //上料长度 StraightDataSource2.Rows[0]["RollingSpeed"] = _StraighPlan.RollingSpeed; //使用长度 StraightDataSource2.Rows[0]["Deflection"] = _StraighPlan.Deflection; //未使用长度 //StraightDataSource2.Rows[0]["RollAngle"] = _StraighPlan.PlineCode; ////切损去向 //StraightDataSource2.Rows[0]["RollSpace"] = _StraighPlan.RollerSpace; //倍尺数 StraightDataSource2.Rows[0]["RollerUpAngle11"] = _StraighPlan.RollerUpAngle11; //单倍长度 StraightDataSource2.Rows[0]["RollerDownAngle11"] = _StraighPlan.RollerDownAngle11; ////计划单倍总支数 StraightDataSource2.Rows[0]["RollerUpAngle12"] = _StraighPlan.RollerUpAngle12; StraightDataSource2.Rows[0]["RollerDownAngle12"] = _StraighPlan.RollerDownAngle12; StraightDataSource2.Rows[0]["RollerUpAngle13"] = _StraighPlan.RollerUpAngle13; StraightDataSource2.Rows[0]["RollerDownAngle13"] = _StraighPlan.RollerDownAngle13; StraightDataSource2.Rows[0]["RollerUpAngle14"] = _StraighPlan.RollerUpAngle14; StraightDataSource2.Rows[0]["RollerDownAngle14"] = _StraighPlan.RollerDownAngle14; StraightDataSource2.Rows[0]["RollerUpAngle15"] = _StraighPlan.RollerUpAngle15; StraightDataSource2.Rows[0]["RollerDownAngle15"] = _StraighPlan.RollerDownAngle15; //StraightDataSource2.Rows[0]["ScrapNumDeatil"] = _StraighPlan.CapillarySize; //StraightDataSource2.Rows[0]["StraingNumDeatil"] = _StraighPlan.CapillarySize; StraightDataSource2.Rows[0]["ScrapNum1"] = _StraighPlan.ScrapNum1; ////开始时间 StraightDataSource2.Rows[0]["ScrapNum2"] = _StraighPlan.ScrapNum2; ////结束时间 StraightDataSource2.Rows[0]["ScrapNum3"] = _StraighPlan.ScrapNum3; StraightDataSource2.Rows[0]["QualifiedNum1"] = _StraighPlan.QualifiedNum1; StraightDataSource2.Rows[0]["QualifiedNum2"] = _StraighPlan.QualifiedNum2; StraightDataSource2.Rows[0]["QualifiedNum3"] = _StraighPlan.QualifiedNum3; StraightDataSource2.Rows[0]["ScrapNum"] = _StraighPlan.ScrapNum; StraightDataSource2.Rows[0]["QualifiedNum"] = _StraighPlan.QualifiedNum; //StraightDataSource2.Rows[0]["StraightNo2"] = _StraighPlan.ExecutiveProducer; //StraightDataSource2.Rows[0]["StraightNo3"] = _StraighPlan.ProducerTime; ////开始时间 StraightDataSource2.Rows[0]["RollerUpAngle21"] = _StraighPlan.RollerUpAngle21; ////结束时间 StraightDataSource2.Rows[0]["RollerDownAngle21"] = _StraighPlan.RollerDownAngle21; StraightDataSource2.Rows[0]["RollerDownAngle22"] = _StraighPlan.RollerDownAngle22; ////单倍长度 StraightDataSource2.Rows[0]["RollerDownAngle23"] = _StraighPlan.RollerDownAngle23; ////计划单倍总支数 StraightDataSource2.Rows[0]["RollerDownAngle24"] = _StraighPlan.RollerDownAngle24; StraightDataSource2.Rows[0]["RollerDownAngle25"] = _StraighPlan.RollerDownAngle25; StraightDataSource2.Rows[0]["RollerUpAngle22"] = _StraighPlan.RollerUpAngle22; StraightDataSource2.Rows[0]["RollerUpAngle23"] = _StraighPlan.RollerUpAngle23; StraightDataSource2.Rows[0]["RollerUpAngle24"] = _StraighPlan.RollerUpAngle24; StraightDataSource2.Rows[0]["RollerUpAngle25"] = _StraighPlan.RollerUpAngle25; StraightDataSource2.Rows[0]["RollerUpAngle31"] = _StraighPlan.RollerUpAngle31; StraightDataSource2.Rows[0]["RollerUpAngle32"] = _StraighPlan.RollerUpAngle32; ////开始时间 StraightDataSource2.Rows[0]["RollerUpAngle33"] = _StraighPlan.RollerUpAngle33; ////结束时间 StraightDataSource2.Rows[0]["RollerUpAngle34"] = _StraighPlan.RollerUpAngle34; StraightDataSource2.Rows[0]["RollerUpAngle35"] = _StraighPlan.RollerUpAngle35; StraightDataSource2.Rows[0]["RollerDownAngle31"] = _StraighPlan.RollerDownAngle31; ////开始时间 StraightDataSource2.Rows[0]["RollerDownAngle32"] = _StraighPlan.RollerDownAngle32; StraightDataSource2.Rows[0]["RollerDownAngle33"] = _StraighPlan.RollerDownAngle33; StraightDataSource2.Rows[0]["RollerDownAngle34"] = _StraighPlan.RollerDownAngle34; StraightDataSource2.Rows[0]["RollerDownAngle35"] = _StraighPlan.RollerDownAngle35; StraightDataSource2.Rows[0]["RollerSpace15"] = _StraighPlan.RollerSpace15; StraightDataSource2.Rows[0]["RollerSpace21"] = _StraighPlan.RollerSpace21; StraightDataSource2.Rows[0]["RollerSpace22"] = _StraighPlan.RollerSpace22; StraightDataSource2.Rows[0]["RollerSpace23"] = _StraighPlan.RollerSpace23; StraightDataSource2.Rows[0]["RollerSpace24"] = _StraighPlan.RollerSpace24; StraightDataSource2.Rows[0]["RollerSpace25"] = _StraighPlan.RollerSpace25; ////结束时间 StraightDataSource2.Rows[0]["RollerSpace31"] = _StraighPlan.RollerSpace31; StraightDataSource2.Rows[0]["RollerSpace32"] = _StraighPlan.RollerSpace32; StraightDataSource2.Rows[0]["RollerSpace33"] = _StraighPlan.RollerSpace33; ////开始时间 StraightDataSource2.Rows[0]["RollerSpace34"] = _StraighPlan.RollerSpace34; StraightDataSource2.Rows[0]["RollerSpace35"] = _StraighPlan.RollerSpace35; StraightDataSource2.Rows[0]["SootBlowingTime"] = _StraighPlan.SootBlowingTime; StraightDataSource2.Rows[0]["RollerSpace11"] = _StraighPlan.RollerSpace11; StraightDataSource2.Rows[0]["RollerSpace12"] = _StraighPlan.RollerSpace12; StraightDataSource2.Rows[0]["RollerSpace13"] = _StraighPlan.RollerSpace13; StraightDataSource2.Rows[0]["RollerSpace14"] = _StraighPlan.RollerSpace14; //StraightDataSource2.Rows[0]["Angle3#"] = _StraighPlan.GuideDiscMotorLoca; //StraightDataSource2.Rows[0]["Angle5#"] = _StraighPlan.DbLoca; ////开始时间 StraightDataSource2.Rows[0]["InMatNum"] = _StraighPlan.InMatNum; ////结束时间 //StraightDataSource2.Rows[0]["StraightNo1"] = _StraighPlan.st; StraightDataSource2.Rows[0]["ExecutiveProducer"] = _StraighPlan.ExecutiveProducer; StraightDataSource2.Rows[0]["StartTime"] = _StraighPlan.StartTime; ////开始时间 StraightDataSource2.Rows[0]["EndTime"] = _StraighPlan.EndTime; StraightDataSource2.Rows[0]["ChangeNum"] = _StraighPlan.ChangeNum; } } public void NoUsing1() { //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle14"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle15"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle14"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle15"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace14"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace15"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["ScrapNumDeatil1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["StraingNumDeatil1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; } public void NoUsing2() { //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle24"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle25"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle24"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle25"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace24"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace25"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["ScrapNumDeatil2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["StraingNumDeatil2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; } public void NoUsing3() { //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle31"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle33"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle34"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle35"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle31"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle33"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle34"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle35"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace31"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace33"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace34"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace35"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["ScrapNumDeatil3"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["StraingNumDeatil3"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; } private void ultraGrid2_CellDataError(object sender, CellDataErrorEventArgs e) { e.RaiseErrorEvent = false; //e.StayInEditMode = true; bool result = false; try { DateTime.Parse(this.ultraGrid2.Rows[0].Cells["StartTime"].ToString()); result = true; } catch { } if (!result) { MessageBox.Show("您输入的开始时间格式不正确,请重新输入。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }