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 FrmStraighteningResult2 : UserControl { private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null; public FrmStraighteningResult2() { InitializeComponent(); GridHelper.InitCardGrid(StraightDataSource2, ultraGrid2); _grid = this.ultraGrid2; } 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 ultraGrid2_CellChange(object sender, CellEventArgs e) { this.IsCellSelect = true; } public void UpdateData() { //来料支数 StraightDataSource2.Rows[0]["InMatNum"] = _StraighPlan.InMatNum; //矫废支数 StraightDataSource2.Rows[0]["ScrapNum"] = _StraighPlan.ScrapNum; //合格支数 StraightDataSource2.Rows[0]["QualifiedNum"] = _StraighPlan.QualifiedNum; //交接班支数 StraightDataSource2.Rows[0]["ChangeNum"] = _StraighPlan.ChangeNum; //备注 StraightDataSource2.Rows[0]["Remark"] = _StraighPlan.Remark; //主电机速度 StraightDataSource2.Rows[0]["MainMotorSpeed"] = _StraighPlan.MainMotorSpeed; //中间偏移量 StraightDataSource2.Rows[0]["MiddleRollerSpace"] = _StraighPlan.MiddleRollerSpace; //2#主电机速度 StraightDataSource2.Rows[0]["MainMotorSpeed2"] = _StraighPlan.MainMotorSpeed2; //2#中间偏移量 StraightDataSource2.Rows[0]["MiddleRollerSpace2"] = _StraighPlan.MiddleRollerSpace2; //吹吸灰时间 StraightDataSource2.Rows[0]["SootBlowingTime"] = _StraighPlan.SootBlowingTime; //开始时间 StraightDataSource2.Rows[0]["StartTime"] = _StraighPlan.StartTime; //结时间 StraightDataSource2.Rows[0]["EndTime"] = _StraighPlan.EndTime; //1‘1#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle11"] = _StraighPlan.RollerUpAngle11; //1’1#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle11"] = _StraighPlan.RollerDownAngle11; //1‘2#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle12"] = _StraighPlan.RollerUpAngle12; //1’2#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle12"] = _StraighPlan.RollerDownAngle12; //1‘3#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle13"] = _StraighPlan.RollerUpAngle13; //1’3#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle13"] = _StraighPlan.RollerDownAngle13; //1‘4#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle14"] = _StraighPlan.RollerUpAngle14; //1’4#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle14"] = _StraighPlan.RollerDownAngle14; //1‘5#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle15"] = _StraighPlan.RollerUpAngle15; //1’5#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle15"] = _StraighPlan.RollerDownAngle15; //1‘6#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle16"] = _StraighPlan.RollerUpAngle16; //1’6#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle16"] = _StraighPlan.RollerDownAngle16; //2‘1#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle21"] = _StraighPlan.RollerUpAngle21; //2’1#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle21"] = _StraighPlan.RollerDownAngle21; //2‘2#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle22"] = _StraighPlan.RollerUpAngle22; //2’2#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle22"] = _StraighPlan.RollerDownAngle22; //2‘3#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle23"] = _StraighPlan.RollerUpAngle23; //2’3#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle23"] = _StraighPlan.RollerDownAngle23; //2‘4#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle24"] = _StraighPlan.RollerUpAngle24; //2’4#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle24"] = _StraighPlan.RollerDownAngle24; //2‘5#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle25"] = _StraighPlan.RollerUpAngle25; //2’5#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle25"] = _StraighPlan.RollerDownAngle25; //2‘6#矫直辊上角度 StraightDataSource2.Rows[0]["RollerUpAngle26"] = _StraighPlan.RollerUpAngle26; //2’6#矫直辊下角度 StraightDataSource2.Rows[0]["RollerDownAngle26"] = _StraighPlan.RollerDownAngle26; //1‘1#矫直辊间距 StraightDataSource2.Rows[0]["RollerSpace11"] = _StraighPlan.RollerSpace11; //1’2#矫直辊间距 StraightDataSource2.Rows[0]["RollerSpace12"] = _StraighPlan.RollerSpace12; //1’3#矫直辊间距 StraightDataSource2.Rows[0]["RollerSpace13"] = _StraighPlan.RollerSpace13; //2‘1#矫直辊间距 StraightDataSource2.Rows[0]["RollerSpace21"] = _StraighPlan.RollerSpace21; //2‘2#矫直辊间距 StraightDataSource2.Rows[0]["RollerSpace22"] = _StraighPlan.RollerSpace22; //2‘3#矫直辊间距 StraightDataSource2.Rows[0]["RollerSpace23"] = _StraighPlan.RollerSpace23; //1‘操作台矫废支数 StraightDataSource2.Rows[0]["ScrapNum1"] = _StraighPlan.ScrapNum1; //1‘操作台矫废支数 StraightDataSource2.Rows[0]["QualifiedNum1"] = _StraighPlan.QualifiedNum1; //2‘操作台矫废支数 StraightDataSource2.Rows[0]["ScrapNum2"] = _StraighPlan.ScrapNum2; //2’操作台合格支数 StraightDataSource2.Rows[0]["QualifiedNum2"] = _StraighPlan.QualifiedNum2; } 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["RollerUpAngle16"].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["RollerDownAngle16"].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["ScrapNum1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["QualifiedNum1"].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["RollerUpAngle26"].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["RollerDownAngle26"].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["ScrapNum2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //this.ultraGrid2.DisplayLayout.Bands[0].Columns["QualifiedNum2"].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); } } } }