using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Qcm.model; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using System; using System.Drawing; namespace Core.StlMes.Client.Qcm { public partial class PopupGrandeRSpec : FrmBase { private string _msc = ""; public string Msc { get { return _msc; } set { _msc = value; } } private string _mscPline = ""; public string MscPline { get { return _mscPline; } set { _mscPline = value; } } private string _gradeCode = ""; public string GradeCode { get { return _gradeCode; } set { _gradeCode = value; } } private DtGrandeRSpec _dtGradeRSpec = null; public PopupGrandeRSpec(string msc, string mscPline, string gradeCode, OpeBase ob) { InitializeComponent(); ExceptionHelper.RegistException(); _msc = msc; _mscPline = mscPline; _gradeCode = gradeCode; this.ob = ob; _dtGradeRSpec = new DtGrandeRSpec(this); EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid2.DisplayLayout.Bands[0]); _dtGradeRSpec.DoQuery("QueryGrade"); } private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "查询": _dtGradeRSpec.DoQuery("QueryGrade"); break; case "保存": _dtGradeRSpec.DoAction(ActionType.Save); break; case "作废": _dtGradeRSpec.DoAction(ActionType.Delete); break; case "恢复": _dtGradeRSpec.DoAction(ActionType.Resume); break; case "关闭": this.Close(); break; } } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { _dtGradeRSpec.DoQuery("QueryGradeRSpec"); } private void PopupGrandeRSpec_Shown(object sender, EventArgs e) { GridHelper.RefreshAndAutoSize(ultraGrid1); GridHelper.RefreshAndAutoSize(ultraGrid2); } private void ultraGrid2_BeforeRowInsert(object sender, Infragistics.Win.UltraWinGrid.BeforeRowInsertEventArgs e) { } private void ultraGrid2_AfterRowInsert(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e) { ComMscGradeRSpecEntity comMscGradeRSpecEntity = (ComMscGradeRSpecEntity)e.Row.ListObject; ComMscGradeEntity comMscGradeEntity = (ComMscGradeEntity)ultraGrid1.ActiveRow.ListObject; comMscGradeRSpecEntity.Msc = comMscGradeEntity.Msc; comMscGradeRSpecEntity.MscPline = comMscGradeEntity.MscPline; comMscGradeRSpecEntity.Gradecode = comMscGradeEntity.Gradecode; comMscGradeRSpecEntity.Gradename = comMscGradeEntity.Gradename; } private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { ComMscGradeEntity comMscGradeEntity = (ComMscGradeEntity)e.Row.ListObject; if (comMscGradeEntity.Validflag.ToString() == "0") { e.Row.Appearance.ForeColor = Color.Red; } else { e.Row.Appearance.ForeColor = Color.Black; } } private void ultraGrid2_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { ComMscGradeRSpecEntity comMscGradeRSpecEntity = (ComMscGradeRSpecEntity)e.Row.ListObject; if (comMscGradeRSpecEntity.Validflag.ToString() == "0") { e.Row.Appearance.ForeColor = Color.Red; } else { e.Row.Appearance.ForeColor = Color.Black; } ControlGrid2Edit(e); } private void ControlGrid2Edit(InitializeRowEventArgs e) { if (e.Row.GetValue("CHK") == "True") { e.Row.Cells["HeightMin"].Activation = Activation.AllowEdit; e.Row.Cells["HeightMiax"].Activation = Activation.AllowEdit; e.Row.Cells["DimaterMin"].Activation = Activation.AllowEdit; e.Row.Cells["DimaterMax"].Activation = Activation.AllowEdit; e.Row.Cells["Memo"].Activation = Activation.AllowEdit; } else { e.Row.Cells["HeightMin"].Activation = Activation.ActivateOnly; e.Row.Cells["HeightMiax"].Activation = Activation.ActivateOnly; e.Row.Cells["DimaterMin"].Activation = Activation.ActivateOnly; e.Row.Cells["DimaterMax"].Activation = Activation.ActivateOnly; e.Row.Cells["Memo"].Activation = Activation.ActivateOnly; } } } }