| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- 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<ComMscGradeEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<ComMscGradeRSpecEntity>(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;
- }
- }
- }
- }
|