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 PerforationResult : UserControl { private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null; public event KeyPressEventHandler GridKeyPress; public event CellEventHandler GridCellChange; public PerforationResult() { InitializeComponent(); GridHelper.InitCardGrid(PerforationDateSource, ultraGrid1); _grid = this.ultraGrid1; } private MilPerforationResultEntity _feedPlan = new MilPerforationResultEntity(); [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public MilPerforationResultEntity Value { get { return _feedPlan; } set { if (value != null) { _feedPlan = value; UpdateData(); } } } private bool isCellSelect = false; public bool IsCellSelect { get { return isCellSelect; } set { isCellSelect = value; } } private void ultraGrid2_CellChange(object sender, CellEventArgs e) { if (GridCellChange != null) { GridCellChange(sender, e); } this.IsCellSelect = true; } public void UpdateData() { if (_feedPlan != null) { double DbUp = 0; double DbDown = 0; double RollerUp = 0; double RollerDown = 0; if (!string.IsNullOrEmpty(_feedPlan.DbLoca.ToString())) { DbUp = double.Parse(_feedPlan.DbLoca.ToString()); } if (!string.IsNullOrEmpty(_feedPlan.DbLocaDown.ToString())) { DbDown = double.Parse(_feedPlan.DbLocaDown.ToString()); } if (!string.IsNullOrEmpty(_feedPlan.ZgLocaUp.ToString())) { RollerUp = double.Parse(_feedPlan.ZgLocaUp.ToString()); } if (!string.IsNullOrEmpty(_feedPlan.ZgLocaDown.ToString())) { RollerDown = double.Parse(_feedPlan.ZgLocaDown.ToString()); } //辊距 PerforationDateSource.Rows[0]["roller_space"] = _feedPlan.RollerSpace; //导距 PerforationDateSource.Rows[0]["guide_space"] = _feedPlan.GuideSpace; //单倍长度 PerforationDateSource.Rows[0]["front_extending_quantity"] = _feedPlan.FrontExtendingQuantity; ////计划单倍总支数 PerforationDateSource.Rows[0]["bite_angle"] = _feedPlan.BiteAngle; PerforationDateSource.Rows[0]["head_diameter"] = _feedPlan.HeadDiameter; //PerforationDateSource.Rows[0]["ScrapDBNum"] = _feedPlan.ScrapNum; PerforationDateSource.Rows[0]["roll_motor_speed"] = _feedPlan.RollMotorSpeed; PerforationDateSource.Rows[0]["guide_disc_motor_speed"] = _feedPlan.GuideDiscMotorSpeed; //PerforationDateSource.Rows[0]["borax_tank"] = _feedPlan.BoraxTank; PerforationDateSource.Rows[0]["borax_pressure"] = _feedPlan.BoraxPressure; PerforationDateSource.Rows[0]["AMOUNT_OF_BORAX"] = _feedPlan.AmountOfBorax; PerforationDateSource.Rows[0]["CapillarySize"] = _feedPlan.CapillarySize; //PerforationDateSource.Rows[0]["CAPOLLARY_DIAMETER"] = _feedPlan.CapillarySize; PerforationDateSource.Rows[0]["capollary_wall_thickness"] = _feedPlan.CapollaryWallThickness; ////开始时间 //PerforationDateSource.Rows[0]["begin_rolling_temp"] = _feedPlan.BeginRollingTemp; ////结束时间 //PerforationDateSource.Rows[0]["slab_diameter"] = _feedPlan.SlabDiameter; //PerforationDateSource.Rows[0]["slab_length"] = _feedPlan.SlabLength; ////单倍长度 PerforationDateSource.Rows[0]["perforation_num"] = _feedPlan.PerforationNum; ////计划单倍总支数 PerforationDateSource.Rows[0]["scrap_num"] = _feedPlan.ScrapNum; //PerforationDateSource.Rows[0]["scrap_reason"] = _feedPlan.ScrapReason; PerforationDateSource.Rows[0]["start_time"] = _feedPlan.StartTime; PerforationDateSource.Rows[0]["end_time"] = _feedPlan.EndTime; PerforationDateSource.Rows[0]["Remark"] = _feedPlan.Remark; PerforationDateSource.Rows[0]["JzbNum"] = _feedPlan.JzbNum; PerforationDateSource.Rows[0]["kz_temp"] = _feedPlan.KzTemp; PerforationDateSource.Rows[0]["dp_gg"] = _feedPlan.DpGg; PerforationDateSource.Rows[0]["guide_disc_motor_loca"] = _feedPlan.GuideDiscMotorLoca; PerforationDateSource.Rows[0]["db_loca_up"] = _feedPlan.DbLoca; ////开始时间 PerforationDateSource.Rows[0]["roll_motor_sjb"] = _feedPlan.RollMotorSjb; ////结束时间 PerforationDateSource.Rows[0]["zg_zj"] = _feedPlan.ZgZj; PerforationDateSource.Rows[0]["dt_code"] = _feedPlan.DtCode; PerforationDateSource.Rows[0]["zg_loca_up"] = _feedPlan.ZgLocaUp; ////开始时间 PerforationDateSource.Rows[0]["zg_loca_down"] = _feedPlan.ZgLocaDown; //开轧温度 PerforationDateSource.Rows[0]["beginRollingTemp"] = _feedPlan.BeginRollingTemp; //交班取消 PerforationDateSource.Rows[0]["CHANGENUMCANCEL"] = "交班取消"; } } public void UpdateDataForRack() { if (_feedPlan != null) { //单倍长度 PerforationDateSource.Rows[0]["front_extending_quantity"] = _feedPlan.FrontExtendingQuantity; PerforationDateSource.Rows[0]["perforation_num"] = _feedPlan.PerforationNum; ////计划单倍总支数 PerforationDateSource.Rows[0]["scrap_num"] = _feedPlan.ScrapNum; PerforationDateSource.Rows[0]["JzbNum"] = _feedPlan.JzbNum; //交班取消 PerforationDateSource.Rows[0]["CHANGENUMCANCEL"] = "交班取消"; } } public void UpdateDataForGuideSpace() { if (_feedPlan != null) { //导距 PerforationDateSource.Rows[0]["guide_space"] = _feedPlan.GuideSpace; } } public void UpdateDataForRollerSpace() { if (_feedPlan != null) { //辊距 PerforationDateSource.Rows[0]["roller_space"] = _feedPlan.RollerSpace; } } public void UpdateDateForPrama(MilPerforationResultEntity PerResultEdit) { if (PerResultEdit != null) { PerforationDateSource.Rows[0]["roller_space"] = PerResultEdit.RollerSpace; //倍尺数 PerforationDateSource.Rows[0]["guide_space"] = PerResultEdit.GuideSpace; //单倍长度 PerforationDateSource.Rows[0]["front_extending_quantity"] = PerResultEdit.FrontExtendingQuantity; ////计划单倍总支数 PerforationDateSource.Rows[0]["bite_angle"] = PerResultEdit.BiteAngle; PerforationDateSource.Rows[0]["head_diameter"] = PerResultEdit.HeadDiameter; PerforationDateSource.Rows[0]["roll_motor_speed"] = PerResultEdit.RollMotorSpeed; PerforationDateSource.Rows[0]["guide_disc_motor_speed"] = PerResultEdit.GuideDiscMotorSpeed; //PerforationDateSource.Rows[0]["borax_tank"] = PerResultEdit.BoraxTank; PerforationDateSource.Rows[0]["borax_pressure"] = PerResultEdit.BoraxPressure; PerforationDateSource.Rows[0]["AMOUNT_OF_BORAX"] = PerResultEdit.AmountOfBorax; PerforationDateSource.Rows[0]["CapillarySize"] = PerResultEdit.CapillarySize; //PerforationDateSource.Rows[0]["CAPOLLARY_DIAMETER"] = PerResultEdit.CapillarySize; PerforationDateSource.Rows[0]["capollary_wall_thickness"] = PerResultEdit.CapollaryWallThickness; PerforationDateSource.Rows[0]["kz_temp"] = PerResultEdit.KzTemp; PerforationDateSource.Rows[0]["dp_gg"] = PerResultEdit.DpGg; PerforationDateSource.Rows[0]["guide_disc_motor_loca"] = PerResultEdit.GuideDiscMotorLoca; PerforationDateSource.Rows[0]["db_loca_up"] = PerResultEdit.DbLoca; ////开始时间 PerforationDateSource.Rows[0]["roll_motor_sjb"] = PerResultEdit.RollMotorSjb; ////结束时间 PerforationDateSource.Rows[0]["zg_zj"] = PerResultEdit.ZgZj; PerforationDateSource.Rows[0]["dt_code"] = PerResultEdit.DtCode; PerforationDateSource.Rows[0]["zg_loca_up"] = PerResultEdit.ZgLocaUp; ////开始时间 PerforationDateSource.Rows[0]["zg_loca_down"] = PerResultEdit.ZgLocaDown; //开轧温度 PerforationDateSource.Rows[0]["beginRollingTemp"] = PerResultEdit.BeginRollingTemp; } } public void DataClear() { //计划上料支数 PerforationDateSource.Rows[0]["result_no"] = ""; //上料支数 PerforationDateSource.Rows[0]["lot_no"] = ""; //上料长度 PerforationDateSource.Rows[0]["stove_no"] = ""; //使用长度 PerforationDateSource.Rows[0]["judge_stove_no"] = ""; //未使用长度 PerforationDateSource.Rows[0]["pline_code"] = ""; //切损去向 PerforationDateSource.Rows[0]["roller_space"] = ""; //倍尺数 PerforationDateSource.Rows[0]["guide_space"] = ""; //单倍长度 PerforationDateSource.Rows[0]["front_extending_quantity"] = ""; //计划单倍总支数 PerforationDateSource.Rows[0]["bite_angle"] = ""; PerforationDateSource.Rows[0]["head_diameter"] = ""; PerforationDateSource.Rows[0]["ScrapDBNum"] = ""; PerforationDateSource.Rows[0]["roll_motor_speed"] = ""; PerforationDateSource.Rows[0]["guide_disc_motor_speed"] = ""; PerforationDateSource.Rows[0]["borax_tank"] = ""; PerforationDateSource.Rows[0]["borax_pressure"] = ""; PerforationDateSource.Rows[0]["capollary_wall_thickness"] = ""; //开始时间 PerforationDateSource.Rows[0]["begin_rolling_temp"] = ""; //结束时间 PerforationDateSource.Rows[0]["slab_diameter"] = ""; PerforationDateSource.Rows[0]["slab_length"] = ""; //单倍长度 PerforationDateSource.Rows[0]["perforation_num"] = ""; //计划单倍总支数 PerforationDateSource.Rows[0]["scrap_num"] = ""; PerforationDateSource.Rows[0]["scrap_reason"] = ""; PerforationDateSource.Rows[0]["start_time"] = ""; PerforationDateSource.Rows[0]["end_time"] = ""; PerforationDateSource.Rows[0]["node_fur_flag"] = ""; PerforationDateSource.Rows[0]["borax_tank"] = ""; PerforationDateSource.Rows[0]["executive_producer"] = ""; PerforationDateSource.Rows[0]["producer_time"] = ""; //开始时间 PerforationDateSource.Rows[0]["producer_tel"] = ""; //结束时间 PerforationDateSource.Rows[0]["remark"] = ""; PerforationDateSource.Rows[0]["col_mode"] = ""; //单倍长度 PerforationDateSource.Rows[0]["col_time"] = ""; //计划单倍总支数 PerforationDateSource.Rows[0]["col_user"] = ""; PerforationDateSource.Rows[0]["col_shift"] = ""; PerforationDateSource.Rows[0]["col_group"] = ""; PerforationDateSource.Rows[0]["jzb_num"] = ""; PerforationDateSource.Rows[0]["kz_temp"] = ""; PerforationDateSource.Rows[0]["dp_gg"] = ""; PerforationDateSource.Rows[0]["guide_disc_motor_loca"] = ""; PerforationDateSource.Rows[0]["db_loca_up"] = ""; //开始时间 PerforationDateSource.Rows[0]["roll_motor_sjb"] = ""; //结束时间 PerforationDateSource.Rows[0]["zg_zj"] = ""; PerforationDateSource.Rows[0]["dt_code"] = ""; PerforationDateSource.Rows[0]["zg_loca_up"] = ""; //开始时间 PerforationDateSource.Rows[0]["zg_loca_down"] = ""; //结束时间 PerforationDateSource.Rows[0]["beginRollingTemp"] = ""; } private void ultraGrid1_KeyDown(object sender, KeyEventArgs e) { } private void ultraGrid1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { ultraGrid1.PerformAction(UltraGridAction.NextCell); ultraGrid1.PerformAction(UltraGridAction.EnterEditMode); } } private void ultraGrid1_Error(object sender, ErrorEventArgs e) { e.Cancel = true; if (ultraGrid1.ActiveCell.Column.Key == "start_time" || ultraGrid1.ActiveCell.Column.Key == "end_time") { MessageBox.Show("请输入完整的时间"); } } } }