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 FrmStraighteningResult1 : UserControl { private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null; public FrmStraighteningResult1() { InitializeComponent(); GridHelper.InitCardGrid(StraightDataSource4, ultraGrid4); _grid = this.ultraGrid4; } private MilStraighteningResultEntity _StraighPlan = new MilStraighteningResultEntity(); 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 ultraGrid4_CellChange(object sender, CellEventArgs e) { this.IsCellSelect = true; } public void UpdateData() { StraightDataSource4.Rows[0]["Remark"] = _StraighPlan.Remark; //上料支数 //StraightDataSource4.Rows[0]["OperatingTable"] = _StraighPlan.LotNo; //上料长度 StraightDataSource4.Rows[0]["RollingSpeed"] = _StraighPlan.RollingSpeed; //使用长度 StraightDataSource4.Rows[0]["MainMotorSpeed"] = _StraighPlan.MainMotorSpeed; //未使用长度 //StraightDataSource4.Rows[0]["RollAngle"] = _StraighPlan.PlineCode; ////切损去向 //StraightDataSource4.Rows[0]["RollSpace"] = _StraighPlan.RollerSpace; //倍尺数 StraightDataSource4.Rows[0]["RollerUpAngle11"] = _StraighPlan.RollerUpAngle11; //单倍长度 StraightDataSource4.Rows[0]["RollerDownAngle11"] = _StraighPlan.RollerDownAngle11; ////计划单倍总支数 StraightDataSource4.Rows[0]["RollerUpAngle12"] = _StraighPlan.RollerUpAngle12; StraightDataSource4.Rows[0]["RollerDownAngle12"] = _StraighPlan.RollerDownAngle12; StraightDataSource4.Rows[0]["RollerUpAngle13"] = _StraighPlan.RollerUpAngle13; StraightDataSource4.Rows[0]["RollerDownAngle13"] = _StraighPlan.RollerDownAngle13; StraightDataSource4.Rows[0]["RollerUpAngle14"] = _StraighPlan.RollerUpAngle14; StraightDataSource4.Rows[0]["RollerDownAngle14"] = _StraighPlan.RollerDownAngle14; StraightDataSource4.Rows[0]["RollerUpAngle15"] = _StraighPlan.RollerUpAngle15; StraightDataSource4.Rows[0]["RollerDownAngle15"] = _StraighPlan.RollerDownAngle15; //StraightDataSource4.Rows[0]["ScrapNumDeatil"] = _StraighPlan.CapillarySize; //StraightDataSource4.Rows[0]["StraingNumDeatil"] = _StraighPlan.CapillarySize; StraightDataSource4.Rows[0]["MiddleRollerSpace"] = _StraighPlan.MiddleRollerSpace; StraightDataSource4.Rows[0]["ScrapNum1"] = _StraighPlan.ScrapNum1; ////开始时间 StraightDataSource4.Rows[0]["ScrapNum2"] = _StraighPlan.ScrapNum2; ////结束时间 StraightDataSource4.Rows[0]["ScrapNum3"] = _StraighPlan.ScrapNum3; StraightDataSource4.Rows[0]["QualifiedNum1"] = _StraighPlan.QualifiedNum1; StraightDataSource4.Rows[0]["QualifiedNum2"] = _StraighPlan.QualifiedNum2; StraightDataSource4.Rows[0]["QualifiedNum3"] = _StraighPlan.QualifiedNum3; StraightDataSource4.Rows[0]["ScrapNum"] = _StraighPlan.ScrapNum; StraightDataSource4.Rows[0]["QualifiedNum"] = _StraighPlan.QualifiedNum; //StraightDataSource4.Rows[0]["StraightNo2"] = _StraighPlan.ExecutiveProducer; //StraightDataSource4.Rows[0]["StraightNo3"] = _StraighPlan.ProducerTime; ////开始时间 StraightDataSource4.Rows[0]["RollerUpAngle21"] = _StraighPlan.RollerUpAngle21; ////结束时间 StraightDataSource4.Rows[0]["RollerDownAngle21"] = _StraighPlan.RollerDownAngle21; StraightDataSource4.Rows[0]["RollerDownAngle22"] = _StraighPlan.RollerDownAngle22; ////单倍长度 StraightDataSource4.Rows[0]["RollerDownAngle23"] = _StraighPlan.RollerDownAngle23; ////计划单倍总支数 StraightDataSource4.Rows[0]["RollerDownAngle24"] = _StraighPlan.RollerDownAngle24; StraightDataSource4.Rows[0]["RollerDownAngle25"] = _StraighPlan.RollerDownAngle25; StraightDataSource4.Rows[0]["RollerUpAngle22"] = _StraighPlan.RollerUpAngle22; StraightDataSource4.Rows[0]["RollerUpAngle23"] = _StraighPlan.RollerUpAngle23; StraightDataSource4.Rows[0]["RollerUpAngle24"] = _StraighPlan.RollerUpAngle24; StraightDataSource4.Rows[0]["RollerUpAngle25"] = _StraighPlan.RollerUpAngle25; StraightDataSource4.Rows[0]["RollerUpAngle31"] = _StraighPlan.RollerUpAngle31; StraightDataSource4.Rows[0]["RollerUpAngle32"] = _StraighPlan.RollerUpAngle32; ////开始时间 StraightDataSource4.Rows[0]["RollerUpAngle33"] = _StraighPlan.RollerUpAngle33; ////结束时间 StraightDataSource4.Rows[0]["RollerUpAngle34"] = _StraighPlan.RollerUpAngle34; StraightDataSource4.Rows[0]["RollerUpAngle35"] = _StraighPlan.RollerUpAngle35; StraightDataSource4.Rows[0]["RollerDownAngle31"] = _StraighPlan.RollerDownAngle31; ////开始时间 StraightDataSource4.Rows[0]["RollerDownAngle32"] = _StraighPlan.RollerDownAngle32; StraightDataSource4.Rows[0]["RollerDownAngle33"] = _StraighPlan.RollerDownAngle33; StraightDataSource4.Rows[0]["RollerDownAngle34"] = _StraighPlan.RollerDownAngle34; StraightDataSource4.Rows[0]["RollerDownAngle35"] = _StraighPlan.RollerDownAngle35; StraightDataSource4.Rows[0]["RollerSpace15"] = _StraighPlan.RollerSpace15; StraightDataSource4.Rows[0]["RollerSpace21"] = _StraighPlan.RollerSpace21; StraightDataSource4.Rows[0]["RollerSpace22"] = _StraighPlan.RollerSpace22; StraightDataSource4.Rows[0]["RollerSpace23"] = _StraighPlan.RollerSpace23; StraightDataSource4.Rows[0]["RollerSpace24"] = _StraighPlan.RollerSpace24; StraightDataSource4.Rows[0]["RollerSpace25"] = _StraighPlan.RollerSpace25; ////结束时间 StraightDataSource4.Rows[0]["RollerSpace31"] = _StraighPlan.RollerSpace31; StraightDataSource4.Rows[0]["RollerSpace32"] = _StraighPlan.RollerSpace32; StraightDataSource4.Rows[0]["RollerSpace33"] = _StraighPlan.RollerSpace33; ////开始时间 StraightDataSource4.Rows[0]["RollerSpace34"] = _StraighPlan.RollerSpace34; StraightDataSource4.Rows[0]["RollerSpace35"] = _StraighPlan.RollerSpace35; StraightDataSource4.Rows[0]["SootBlowingTime"] = _StraighPlan.SootBlowingTime; StraightDataSource4.Rows[0]["RollerSpace11"] = _StraighPlan.RollerSpace11; StraightDataSource4.Rows[0]["RollerSpace12"] = _StraighPlan.RollerSpace12; StraightDataSource4.Rows[0]["RollerSpace13"] = _StraighPlan.RollerSpace13; StraightDataSource4.Rows[0]["RollerSpace14"] = _StraighPlan.RollerSpace14; //StraightDataSource4.Rows[0]["Angle3#"] = _StraighPlan.GuideDiscMotorLoca; //StraightDataSource4.Rows[0]["Angle5#"] = _StraighPlan.DbLoca; ////开始时间 StraightDataSource4.Rows[0]["InMatNum"] = _StraighPlan.InMatNum; ////结束时间 //StraightDataSource4.Rows[0]["StraightNo1"] = _StraighPlan.st; StraightDataSource4.Rows[0]["ExecutiveProducer"] = _StraighPlan.ExecutiveProducer; StraightDataSource4.Rows[0]["StartTime"] = _StraighPlan.StartTime; StraightDataSource4.Rows[0]["EndTime"] = _StraighPlan.EndTime; StraightDataSource4.Rows[0]["ChangeNum"] = _StraighPlan.ChangeNum; } public void DataClear() { //if (_StraighPlan != null) //{ // StraightDataSource4.Rows[0]["Remark"] = ""; // //上料支数 // //StraightDataSource4.Rows[0]["OperatingTable"] = _StraighPlan.LotNo; // //上料长度 // StraightDataSource4.Rows[0]["Speed"] = ""; // //使用长度 // StraightDataSource4.Rows[0]["ORDER_SIZE_SCOPE"] = ""; // //未使用长度 // //StraightDataSource4.Rows[0]["RollAngle"] = _StraighPlan.PlineCode; // ////切损去向 // //StraightDataSource4.Rows[0]["RollSpace"] = _StraighPlan.RollerSpace; // //倍尺数 // StraightDataSource4.Rows[0]["Up1"] = ""; // //单倍长度 // StraightDataSource4.Rows[0]["Down1"] = ""; // ////计划单倍总支数 // StraightDataSource4.Rows[0]["Up2"] = ""; // StraightDataSource4.Rows[0]["Down2"] = ""; // StraightDataSource4.Rows[0]["Up3"] = ""; // StraightDataSource4.Rows[0]["Down3"] = ""; // StraightDataSource4.Rows[0]["Up4"] = ""; // StraightDataSource4.Rows[0]["Down4"] = ""; // StraightDataSource4.Rows[0]["Up5"] = ""; // StraightDataSource4.Rows[0]["Down5"] = ""; // //StraightDataSource4.Rows[0]["ScrapNumDeatil"] = _StraighPlan.CapillarySize; // //StraightDataSource4.Rows[0]["StraingNumDeatil"] = _StraighPlan.CapillarySize; // StraightDataSource4.Rows[0]["ScrapNumDeatil1"] = ""; // ////开始时间 // StraightDataSource4.Rows[0]["ScrapNumDeatil2"] = ""; // ////结束时间 // StraightDataSource4.Rows[0]["ScrapNumDeatil3"] = ""; // StraightDataSource4.Rows[0]["StraingNumDeatil1"] = ""; // StraightDataSource4.Rows[0]["StraingNumDeatil2"] = ""; // StraightDataSource4.Rows[0]["StraingNumDeatil3"] = ""; // StraightDataSource4.Rows[0]["ScrapNum"] = ""; // StraightDataSource4.Rows[0]["StraightNum"] = ""; // //StraightDataSource4.Rows[0]["StraightNo2"] = _StraighPlan.ExecutiveProducer; // //StraightDataSource4.Rows[0]["StraightNo3"] = _StraighPlan.ProducerTime; // ////开始时间 // StraightDataSource4.Rows[0]["RollAngleUp21"] = ""; // ////结束时间 // StraightDataSource4.Rows[0]["RollAngleDown21"] = ""; // StraightDataSource4.Rows[0]["RollAngleDown22"] = ""; // ////单倍长度 // StraightDataSource4.Rows[0]["RollAngleDown23"] = ""; // ////计划单倍总支数 // StraightDataSource4.Rows[0]["RollAngleDown24"] = ""; // StraightDataSource4.Rows[0]["RollAngleDown25"] = ""; // StraightDataSource4.Rows[0]["RollAngleUp22"] = ""; // StraightDataSource4.Rows[0]["RollAngleUp23"] = ""; // StraightDataSource4.Rows[0]["RollAngleUp24"] = ""; // StraightDataSource4.Rows[0]["RollAngleUp25"] = ""; // StraightDataSource4.Rows[0]["RollAngleUp31"] = ""; // StraightDataSource4.Rows[0]["RollAngleUp32"] = ""; // ////开始时间 // StraightDataSource4.Rows[0]["RollAngleUp33"] = ""; // ////结束时间 // StraightDataSource4.Rows[0]["RollAngleUp34"] = ""; // StraightDataSource4.Rows[0]["RollAngleUp35"] = ""; // StraightDataSource4.Rows[0]["RollAngleDown31"] = ""; // ////开始时间 // StraightDataSource4.Rows[0]["RollAngleDown32"] = ""; // StraightDataSource4.Rows[0]["RollAngleDown33"] = ""; // StraightDataSource4.Rows[0]["RollAngleDown34"] = ""; // StraightDataSource4.Rows[0]["RollAngleDown35"] = ""; // StraightDataSource4.Rows[0]["RollSpace15"] = ""; // StraightDataSource4.Rows[0]["RollSpace21"] = ""; // StraightDataSource4.Rows[0]["RollSpace22"] = ""; // StraightDataSource4.Rows[0]["RollSpace23"] = ""; // StraightDataSource4.Rows[0]["RollSpace24"] = ""; // StraightDataSource4.Rows[0]["RollSpace25"] = ""; // ////结束时间 // StraightDataSource4.Rows[0]["RollSpace31"] = ""; // StraightDataSource4.Rows[0]["RollSpace32"] = ""; // StraightDataSource4.Rows[0]["RollSpace33"] = ""; ; // ////开始时间 // StraightDataSource4.Rows[0]["RollSpace34"] = ""; // StraightDataSource4.Rows[0]["RollSpace35"] = ""; // StraightDataSource4.Rows[0]["BlowDustTime"] = ""; // StraightDataSource4.Rows[0]["RollSpace11"] = ""; // StraightDataSource4.Rows[0]["RollSpace12"] = ""; // StraightDataSource4.Rows[0]["RollSpace13"] = ""; // StraightDataSource4.Rows[0]["RollSpace14"] = ""; // //StraightDataSource4.Rows[0]["Angle3#"] = _StraighPlan.GuideDiscMotorLoca; // //StraightDataSource4.Rows[0]["Angle5#"] = _StraighPlan.DbLoca; // ////开始时间 // StraightDataSource4.Rows[0]["InMatNum"] = ""; // ////结束时间 // //StraightDataSource4.Rows[0]["StraightNo1"] = _StraighPlan.st; // StraightDataSource4.Rows[0]["ExecutiveProducer"] = ""; // StraightDataSource4.Rows[0]["StartTime"] = ""; // ////开始时间 // StraightDataSource4.Rows[0]["EndTime"] = ""; // StraightDataSource4.Rows[0]["ChangeClassNum"] = ""; } public void NoUsing1() { this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["ScrapNum1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["QualifiedNum1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; } public void Using1() { this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["ScrapNum1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly; this.ultraGrid4.DisplayLayout.Bands[0].Columns["QualifiedNum1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly; } public void NoUsing2() { this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["ScrapNum2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ultraGrid4.DisplayLayout.Bands[0].Columns["QualifiedNum2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; } public void Using2() { this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerUpAngle23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerDownAngle23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["RollerSpace23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid4.DisplayLayout.Bands[0].Columns["ScrapNum2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly; this.ultraGrid4.DisplayLayout.Bands[0].Columns["QualifiedNum2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly; } private void ultraGrid4_CellDataError(object sender, CellDataErrorEventArgs e) { e.RaiseErrorEvent = false; //e.StayInEditMode = true; bool result = false; try { DateTime.Parse(this.ultraGrid4.Rows[0].Cells["StartTime"].ToString()); result = true; } catch { } if (!result) { MessageBox.Show("您输入的开始时间格式不正确,请重新输入。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }