| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986 |
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinEditors;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections.Generic;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Qcm
- {
- class ComStandPay
- {
- private delegate void ToolBarClickDelegate(object obj, string key);
- private FrmChemStandard _frmChemStand = null;
- private FrmMaterialStandard _frmMaterialStand = null;
- private FrmTolerancesStandard _frmTolerancesStand = null;
- private FrmComMSCStdDetection _frmComMSCStdDetection = null;
- private FrmWaterPressureStand _frmProductWater = null;
- private FrmComMSCStdProcess _frmComMSCStdProcess = null;
- private Panel _tabChemStand = null;
- private Panel _tabMaterialStand = null;
- private Panel _tabTolerancesStand = null;
- private Panel _tabComMSCStdDetection = null;
- private Panel _tabProductWater = null;
- private Panel _tabComMSCStdProcess = null;
- private CheckBox _ckbDeleteFilter = null;
- private UltraGrid _parentUltraGrid = null;
- private string _customInfo = "";
- private OpeBase _ob = null;
- private Dictionary<string, UltraGrid> _gridDic = new Dictionary<string, UltraGrid>();
- private Dictionary<string, UltraCheckEditor> _checkBoxDic = new Dictionary<string, UltraCheckEditor>();
- private Dictionary<string, FrmBase> _mscFrmDic = new Dictionary<string, FrmBase>();
- public event RowEventHandler AfterRowInsert;
- public Panel TabChemStand
- {
- get
- {
- return _tabChemStand;
- }
- set
- {
- _tabChemStand = value;
- }
- }
- public Panel TabComMSCStdDetection
- {
- get
- {
- return _tabComMSCStdDetection;
- }
- set
- {
- _tabComMSCStdDetection = value;
- }
- }
- public Panel TabMaterialStand
- {
- get
- {
- return _tabMaterialStand;
- }
- set
- {
- _tabMaterialStand = value;
- }
- }
- public Panel TabProductWater
- {
- get
- {
- return _tabProductWater;
- }
- set
- {
- _tabProductWater = value;
- }
- }
- public Panel TabTolerancesStand
- {
- get
- {
- return _tabTolerancesStand;
- }
- set
- {
- _tabTolerancesStand = value;
- }
- }
- public Panel TabComMSCStdProcess
- {
- get { return _tabComMSCStdProcess; }
- set { _tabComMSCStdProcess = value; }
- }
- public CheckBox CkbDeleteFilter
- {
- get
- {
- return _ckbDeleteFilter;
- }
- set
- {
- _ckbDeleteFilter = value;
- }
- }
- public UltraGrid ParentUltraGrid
- {
- get
- {
- return _parentUltraGrid;
- }
- set
- {
- _parentUltraGrid = value;
- }
- }
- public string CustomInfo
- {
- get { return _customInfo; }
- set { _customInfo = value; }
- }
- public ComStandPay(string customInfo, OpeBase ob)
- {
- _customInfo = customInfo;
- _ob = ob;
- }
- public void Load()
- {
- if (_customInfo == "")
- {
- SaveStandPay("1", "ChemStand", new string[] { "ultraGrid1", "ultraCheckValid" });
- //SaveStandPay("2", "ChemStand", new string[] { "ultraGrid1", "ultraCheckValid" });
- //SaveStandPay("3", "ChemStand", new string[] { "ultraGrid1", "ultraCheckValid" });
- LoadStandPay("1", "ChemStand");
- SaveStandPay("1", "ComMSCStdDetection", new string[] { "ultraGrid1", "ultraCheckValid" });
- //SaveStandPay("2", "ComMSCStdDetection", new string[] { "ultraGrid1", "ultraCheckValid" });
- //SaveStandPay("3", "ComMSCStdDetection", new string[] { "ultraGrid1", "ultraCheckValid" });
- LoadStandPay("1", "ComMSCStdDetection");
- SaveStandPay("1", "MaterialStand", new string[] { "ultraGrid1", "ultraCheckEditor2" });
- //SaveStandPay("2", "MaterialStand", new string[] { "ultraGrid1", "ultraCheckEditor2" });
- //SaveStandPay("3", "MaterialStand", new string[] { "ultraGrid1", "ultraCheckEditor2" });
- LoadStandPay("1", "MaterialStand");
- SaveStandPay("1", "ProductWater", new string[] { "ultraGrid1", "ultraCheckValid" });
- //SaveStandPay("2", "ProductWater", new string[] { "ultraGrid1", "ultraCheckValid" });
- //SaveStandPay("3", "ProductWater", new string[] { "ultraGrid1", "ultraCheckValid" });
- LoadStandPay("1", "ProductWater");
- SaveStandPay("1", "TolerancesStand", new string[] { "ultraGrid1", "chkValid" });
- //SaveStandPay("2", "TolerancesStand", new string[] { "ultraGrid1", "chkValid" });
- //SaveStandPay("3", "TolerancesStand", new string[] { "ultraGrid1", "chkValid" });
- LoadStandPay("1", "TolerancesStand");
- SaveStandPay("1", "ComMSCStdProcess", new string[] { "ultraGrid1", "ultraCheckValid" });
- LoadStandPay("1", "ComMSCStdProcess");
- }
- else
- {
- SaveStandPay(_customInfo, "ChemStand", new string[] { "ultraGrid1", "ultraCheckValid" });
- LoadStandPay(_customInfo, "ChemStand");
- SaveStandPay(_customInfo, "ComMSCStdDetection", new string[] { "ultraGrid1", "ultraCheckValid" });
- LoadStandPay(_customInfo, "ComMSCStdDetection");
- SaveStandPay(_customInfo, "MaterialStand", new string[] { "ultraGrid1", "ultraCheckEditor2" });
- LoadStandPay(_customInfo, "MaterialStand");
- SaveStandPay(_customInfo, "ProductWater", new string[] { "ultraGrid1", "ultraCheckValid" });
- LoadStandPay(_customInfo, "ProductWater");
- SaveStandPay(_customInfo, "TolerancesStand", new string[] { "ultraGrid1", "chkValid" });
- LoadStandPay(_customInfo, "TolerancesStand");
- SaveStandPay(_customInfo, "ComMSCStdProcess", new string[] { "ultraGrid1", "ultraCheckValid" });
- LoadStandPay(_customInfo, "ComMSCStdProcess");
- }
- }
- private FrmBase CreateStandPay(string custmInfo, string standPayKey)
- {
- FrmBase mscFrm = null;
- switch (standPayKey)
- {
- case "ChemStand":
- mscFrm = new FrmChemStandard();
- _mscFrmDic.Add(standPayKey + custmInfo, mscFrm);
- return mscFrm;
- case "ComMSCStdDetection":
- mscFrm = new FrmComMSCStdDetection();
- _mscFrmDic.Add(standPayKey + custmInfo, mscFrm);
- return mscFrm;
- case "MaterialStand":
- mscFrm = new FrmMaterialStandard();
- _mscFrmDic.Add(standPayKey + custmInfo, mscFrm);
- return mscFrm;
- case "ProductWater":
- mscFrm = new FrmWaterPressureStand();
- _mscFrmDic.Add(standPayKey + custmInfo, mscFrm);
- return mscFrm;
- case "TolerancesStand":
- mscFrm = new FrmTolerancesStandard();
- _mscFrmDic.Add(standPayKey + custmInfo, mscFrm);
- return mscFrm;
- case "ComMSCStdProcess":
- mscFrm = new FrmComMSCStdProcess();
- _mscFrmDic.Add(standPayKey + custmInfo, mscFrm);
- return mscFrm;
- default:
- return null;
- }
- }
- private Panel GetTabControl(string standPayKey)
- {
- switch (standPayKey)
- {
- case "ChemStand":
- return _tabChemStand;
- case "ComMSCStdDetection":
- return _tabComMSCStdDetection;
- case "MaterialStand":
- return _tabMaterialStand;
- case "ProductWater":
- return _tabProductWater;
- case "TolerancesStand":
- return _tabTolerancesStand;
- case "ComMSCStdProcess":
- return _tabComMSCStdProcess;
- default:
- return null;
- }
- }
- public void LoadStandPay(string customInfo, string standPayKey)
- {
- Panel ultraTabPageControl = GetTabControl(standPayKey);
- ultraTabPageControl.Controls.Clear();
- ultraTabPageControl.Controls.Add(_gridDic[standPayKey + customInfo]);
- ultraTabPageControl.Controls.Add(_checkBoxDic[standPayKey + customInfo]);
- ultraTabPageControl.Tag = customInfo;
- switch (standPayKey)
- {
- case "ChemStand":
- _frmChemStand = (FrmChemStandard)_mscFrmDic[standPayKey + customInfo];
- break;
- case "ComMSCStdDetection":
- _frmComMSCStdDetection = (FrmComMSCStdDetection)_mscFrmDic[standPayKey + customInfo];
- break;
- case "MaterialStand":
- _frmMaterialStand = (FrmMaterialStandard)_mscFrmDic[standPayKey + customInfo];
- break;
- case "ProductWater":
- _frmProductWater = (FrmWaterPressureStand)_mscFrmDic[standPayKey + customInfo];
- break;
- case "TolerancesStand":
- _frmTolerancesStand = (FrmTolerancesStandard)_mscFrmDic[standPayKey + customInfo];
- break;
- case "ComMSCStdProcess":
- _frmComMSCStdProcess = (FrmComMSCStdProcess)_mscFrmDic[standPayKey + customInfo];
- break;
- }
- }
- public void SaveStandPay(string customInfo, string standPayKey, string[] strControls)
- {
- FrmBase frm = CreateStandPay(customInfo, standPayKey);
- //直接调用onload
- if (frm is FrmChemStandard)
- {
- ((FrmChemStandard)frm).PopupLoad(customInfo, _ob);
- }
- else if (frm is FrmComMSCStdDetection)
- {
- ((FrmComMSCStdDetection)frm).PopupLoad(customInfo, _ob);
- }
- else if (frm is FrmMaterialStandard)
- {
- ((FrmMaterialStandard)frm).PopupLoad(customInfo, _ob);
- }
- else if (frm is FrmWaterPressureStand)
- {
- ((FrmWaterPressureStand)frm).PopupLoad(customInfo, _ob);
- }
- else if (frm is FrmTolerancesStandard)
- {
- ((FrmTolerancesStandard)frm).PopupLoad(customInfo, _ob);
- }
- else if (frm is FrmComMSCStdProcess)
- {
- ((FrmComMSCStdProcess)frm).PopupLoad(customInfo, _ob);
- }
- foreach (string strGrid in strControls)
- {
- System.Windows.Forms.Control[] controls = frm.Controls.Find(strGrid, true);
- if (controls.Length > 0)
- {
- //ultraTabPageControl.Controls.Add(controls[0]);
- //ultraTabPageControl.Tag = _customInfo;
- if (controls[0] is UltraCheckEditor)
- {
- UltraCheckEditor checkBox = (UltraCheckEditor)controls[0];
- _checkBoxDic.Add(standPayKey + customInfo, checkBox);
- }
- if (controls[0] is UltraGrid)
- {
- UltraGrid grid = (UltraGrid)controls[0];
- _gridDic.Add(standPayKey + customInfo, grid);
- ControlStandPayEdit(grid);
- grid.BeforeRowInsert += new BeforeRowInsertEventHandler(FrmProPSCMSC2_BeforeRowInsert);
- grid.AfterRowInsert += new RowEventHandler(grid_AfterRowInsert);
- }
- }
- }
- }
- void grid_AfterRowInsert(object sender, RowEventArgs e)
- {
- if (AfterRowInsert != null)
- {
- this.AfterRowInsert.Invoke(sender, e);
- }
- }
- private void ControlStandPayEdit(UltraGrid grid)
- {
- string displayTable = grid.DataMember;
- if (grid.DisplayLayout.Bands[displayTable].Columns.Exists("PSC"))
- {
- grid.DisplayLayout.Bands[displayTable].Columns["PSC"].CellActivation = Activation.ActivateOnly;
- grid.DisplayLayout.Bands[displayTable].Columns["PSC"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
- }
- if (grid.DisplayLayout.Bands[displayTable].Columns.Exists("PSC_DESC"))
- {
- grid.DisplayLayout.Bands[displayTable].Columns["PSC_DESC"].CellActivation = Activation.ActivateOnly;
- grid.DisplayLayout.Bands[displayTable].Columns["PSC_DESC"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
- }
- if (grid.DisplayLayout.Bands[displayTable].Columns.Exists("MSC"))
- {
- grid.DisplayLayout.Bands[displayTable].Columns["MSC"].CellActivation = Activation.ActivateOnly;
- grid.DisplayLayout.Bands[displayTable].Columns["MSC"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
- }
- if (grid.DisplayLayout.Bands[displayTable].Columns.Exists("STD_NAME_NK"))
- {
- grid.DisplayLayout.Bands[displayTable].Columns["STD_NAME_NK"].CellActivation = Activation.ActivateOnly;
- grid.DisplayLayout.Bands[displayTable].Columns["STD_NAME_NK"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
- }
- else if (grid.DisplayLayout.Bands[displayTable].Columns.Exists("STD_NAME"))
- {
- grid.DisplayLayout.Bands[displayTable].Columns["STD_NAME"].CellActivation = Activation.ActivateOnly;
- grid.DisplayLayout.Bands[displayTable].Columns["STD_NAME"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
- }
- if (grid.DisplayLayout.Bands[displayTable].Columns.Exists("STD_CODE_NK"))
- {
- grid.DisplayLayout.Bands[displayTable].Columns["STD_CODE_NK"].CellActivation = Activation.ActivateOnly;
- grid.DisplayLayout.Bands[displayTable].Columns["STD_CODE_NK"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
- }
- else if (grid.DisplayLayout.Bands[displayTable].Columns.Exists("STD_CODE"))
- {
- grid.DisplayLayout.Bands[displayTable].Columns["STD_CODE"].CellActivation = Activation.ActivateOnly;
- grid.DisplayLayout.Bands[displayTable].Columns["STD_CODE"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
- }
- }
- void FrmProPSCMSC2_BeforeRowInsert(object sender, BeforeRowInsertEventArgs e)
- {
- if (_parentUltraGrid != null && _parentUltraGrid.ActiveRow == null)
- {
- e.Cancel = true;
- }
- }
- public void QueryChemStandWithOutFilter()
- {
- ToolClickChemStand("", "", "Query", false);
- }
- public void QueryMaterialStandWithOutFilter()
- {
- ToolClickMaterialStand("", "", "Query", false);
- }
- public void QueryTolerancesStandWithOutFilter()
- {
- ToolClickTolerancesStand("", "", "Query", false);
- }
- public void QueryComMSCStdDetectionWithOutFilter()
- {
- ToolClickComMSCStdDetection("", "", "Query", false);
- }
- public void QueryProductWaterWithOutFilter()
- {
- ToolClickProductWater("", "", "Query", false);
- }
- public void QueryComMSCStdProcessWithOutFilter()
- {
- ToolClickComMSCStdProcess("", "", "Query", false);
- }
- public void QueryChemStand(string alphaNk, string psc)
- {
- ToolClickChemStand(psc, alphaNk, "Query", true);
- }
- public void QueryMaterialStand(string alphaNk, string psc)
- {
- ToolClickMaterialStand(psc, alphaNk, "Query", true);
- }
- public void QueryTolerancesStand(string alphaNk, string psc)
- {
- ToolClickTolerancesStand(psc, alphaNk, "Query", true);
- }
- public void QueryComMSCStdDetection(string alphaNk, string psc)
- {
- ToolClickComMSCStdDetection(psc, alphaNk, "Query", true);
- }
- public void QueryProductWater(string alphaNk, string psc)
- {
- ToolClickProductWater(psc, alphaNk, "Query", true);
- }
- public void QueryComMSCStdProcess(string alphaNk, string psc)
- {
- ToolClickComMSCStdProcess(psc, alphaNk, "Query", true);
- }
- public void SaveChemStand(string alphaNk, string psc)
- {
- ToolClickChemStand(psc, alphaNk, "Save", true);
- }
- public void SaveMaterialStand(string alphaNk, string psc)
- {
- ToolClickMaterialStand(psc, alphaNk, "Save", true);
- }
- public void SaveTolerancesStand(string alphaNk, string psc)
- {
- ToolClickTolerancesStand(psc, alphaNk, "Save", true);
- }
- public void SaveComMSCStdDetection(string alphaNk, string psc)
- {
- ToolClickComMSCStdDetection(psc, alphaNk, "Save", true);
- }
- public void SaveProductWater(string alphaNk, string psc)
- {
- ToolClickProductWater(psc, alphaNk, "Save", true);
- }
- public void SaveComMSCStdProcess(string alphaNk, string psc)
- {
- ToolClickComMSCStdProcess(psc, alphaNk, "Save", true);
- }
- public void DeleteChemStand(string alphaNk, string psc)
- {
- ToolClickChemStand(psc, alphaNk, "Delete", true);
- }
- public void DeleteMaterialStand(string alphaNk, string psc)
- {
- ToolClickMaterialStand(psc, alphaNk, "Delete", true);
- }
- public void DeleteTolerancesStand(string alphaNk, string psc)
- {
- ToolClickTolerancesStand(psc, alphaNk, "Delete", true);
- }
- public void DeleteComMSCStdDetection(string alphaNk, string psc)
- {
- ToolClickComMSCStdDetection(psc, alphaNk, "Delete", true);
- }
- public void DeleteProductWater(string alphaNk, string psc)
- {
- ToolClickProductWater(psc, alphaNk, "Delete", true);
- }
- public void DeleteComMSCStdProcess(string alphaNk, string psc)
- {
- ToolClickComMSCStdProcess(psc, alphaNk, "Delete", true);
- }
- public void ResumeChemStand(string alphaNk, string psc)
- {
- ToolClickChemStand(psc, alphaNk, "Resume", true);
- }
- public void ResumeMaterialStand(string alphaNk, string psc)
- {
- ToolClickMaterialStand(psc, alphaNk, "Resume", true);
- }
- public void ResumeTolerancesStand(string alphaNk, string psc)
- {
- ToolClickTolerancesStand(psc, alphaNk, "Resume", true);
- }
- public void ResumeComMSCStdDetection(string alphaNk, string psc)
- {
- ToolClickComMSCStdDetection(psc, alphaNk, "Resume", true);
- }
- public void ResumeProductWater(string alphaNk, string psc)
- {
- ToolClickProductWater(psc, alphaNk, "Resume", true);
- }
- public void ResumeComMSCStdProcess(string alphaNk, string psc)
- {
- ToolClickComMSCStdProcess(psc, alphaNk, "Resume", true);
- }
- public void RefreshChemStand(string alphaNk, string psc)
- {
- ToolClickChemStand(psc, alphaNk, "Refresh", true);
- }
- public void RefreshMaterialStand(string alphaNk, string psc)
- {
- ToolClickMaterialStand(psc, alphaNk, "Refresh", true);
- }
- public void RefreshTolerancesStand(string alphaNk, string psc)
- {
- ToolClickTolerancesStand(psc, alphaNk, "Refresh", true);
- }
- public void RefreshComMSCStdDetection(string alphaNk, string psc)
- {
- ToolClickComMSCStdDetection(psc, alphaNk, "Refresh", true);
- }
- public void RefreshProductWater(string alphaNk, string psc)
- {
- ToolClickProductWater(psc, alphaNk, "Refresh", true);
- }
- public void RefreshComMSCStdProcess(string alphaNk, string psc)
- {
- ToolClickComMSCStdProcess(psc, alphaNk, "Refresh", true);
- }
- public void CopyChemStand()
- {
- ToolClickChemStand("", "", "Copy", true);
- }
- public void CopyMaterialStand()
- {
- ToolClickMaterialStand("", "", "Copy", true);
- }
- public void CopyTolerancesStand()
- {
- ToolClickTolerancesStand("", "", "Copy", true);
- }
- public void CopyComMSCStdDetection()
- {
- ToolClickComMSCStdDetection("", "", "Copy", true);
- }
- public void CopyProductWater()
- {
- ToolClickProductWater("", "", "Copy", true);
- }
- public void CopyComMSCStdProcess()
- {
- ToolClickComMSCStdProcess("", "", "Copy", true);
- }
- public void PasteChemStand()
- {
- ToolClickChemStand("", "", "Paste", true);
- }
- public void PasteMaterialStand()
- {
- ToolClickMaterialStand("", "", "Paste", true);
- }
- public void PasteTolerancesStand()
- {
- ToolClickTolerancesStand("", "", "Paste", true);
- }
- public void PasteComMSCStdDetection()
- {
- ToolClickComMSCStdDetection("", "", "Paste", true);
- }
- public void PasteProductWater()
- {
- ToolClickProductWater("", "", "Paste", true);
- }
- public void PasteComMSCStdProcess()
- {
- ToolClickComMSCStdProcess("", "", "Paste", true);
- }
- public void GroupMaterialStand(string alphaNk, string psc)
- {
- ToolClickMaterialStand(psc, alphaNk, "Group", true);
- }
- public void GroupComMSCStdDetection(string alphaNk, string psc)
- {
- ToolClickComMSCStdDetection(psc, alphaNk, "Group", true);
- }
- public void CancelGroupComMSCStdDetection(string alphaNk, string psc)
- {
- ToolClickComMSCStdDetection(psc, alphaNk, "Cancel", true);
- }
- public void GroupComMSCStdProcess(string alphaNk, string psc)
- {
- ToolClickComMSCStdProcess(psc, alphaNk, "Group", true);
- }
- public void CancelGroupComMSCStdProcess(string alphaNk, string psc)
- {
- ToolClickComMSCStdProcess(psc, alphaNk, "CancleGroup", true);
- }
- public void CancelGroupMaterialStand(string alphaNk, string psc)
- {
- ToolClickMaterialStand(psc, alphaNk, "Cancel", true);
- }
- private void ToolClickChemStand(string psc, string alphaNk, string toolKey, bool isFilted)
- {
- try
- {
- SetStandPayDeleteFilter(_tabChemStand, "ultraCheckValid", _ckbDeleteFilter.Checked);
- UpdateStandPayGrid(_tabChemStand, "ultraGrid1", true);
- _frmChemStand.StdCode = alphaNk;
- _frmChemStand.ToolBar_Click(null, toolKey);
- if (isFilted)
- {
- StandPayRowFilter(_tabChemStand, "ultraGrid1", psc, alphaNk);
- }
- }
- catch (Exception ex)
- { string msg = ex.Message; }
- finally
- {
- UpdateStandPayGrid(_tabChemStand, "ultraGrid1", false);
- }
- }
- private void ToolClickMaterialStand(string psc, string alphaNk, string toolKey, bool isFilted)
- {
- try
- {
- SetStandPayDeleteFilter(_tabMaterialStand, "ultraCheckEditor2", _ckbDeleteFilter.Checked);
- UpdateStandPayGrid(_tabMaterialStand, "ultraGrid1", true);
- _frmMaterialStand.StdCode = alphaNk;
- _frmMaterialStand.ToolBar_Click(null, toolKey);
- if (isFilted)
- {
- StandPayRowFilter(_tabMaterialStand, "ultraGrid1", psc, alphaNk);
- }
- }
- catch
- { }
- finally
- {
- UpdateStandPayGrid(_tabMaterialStand, "ultraGrid1", false);
- }
- }
- private void ToolClickTolerancesStand(string psc, string alphaNk, string toolKey, bool isFilted)
- {
- try
- {
- SetStandPayDeleteFilter(_tabTolerancesStand, "chkValid", _ckbDeleteFilter.Checked);
- UpdateStandPayGrid(_tabTolerancesStand, "ultraGrid1", true);
- _frmTolerancesStand.StdCode = alphaNk;
- _frmTolerancesStand.ToolBar_Click(null, toolKey);
- if (isFilted)
- {
- StandPayRowFilter(_tabTolerancesStand, "ultraGrid1", psc, alphaNk);
- }
- }
- catch
- { }
- finally
- {
- UpdateStandPayGrid(_tabTolerancesStand, "ultraGrid1", false);
- }
- }
- private void ToolClickComMSCStdDetection(string psc, string alphaNk, string toolKey, bool isFilted)
- {
- try
- {
- SetStandPayDeleteFilter(_tabComMSCStdDetection, "ultraCheckValid", _ckbDeleteFilter.Checked);
- UpdateStandPayGrid(_tabComMSCStdDetection, "ultraGrid1", true);
- _frmComMSCStdDetection.StdCode = alphaNk;
- _frmComMSCStdDetection.ToolBar_Click(null, toolKey);
- if (isFilted)
- {
- StandPayRowFilter(_tabComMSCStdDetection, "ultraGrid1", psc, alphaNk);
- }
- }
- catch
- { }
- finally
- {
- UpdateStandPayGrid(_tabComMSCStdDetection, "ultraGrid1", false);
- }
- }
- private void ToolClickProductWater(string psc, string alphaNk, string toolKey, bool isFilted)
- {
- try
- {
- SetStandPayDeleteFilter(_tabProductWater, "ultraCheckValid", _ckbDeleteFilter.Checked);
- UpdateStandPayGrid(_tabProductWater, "ultraGrid1", true);
- _frmProductWater.StdCode = alphaNk;
- _frmProductWater.ToolBar_Click(null, toolKey);
- if (isFilted)
- {
- StandPayRowFilter(_tabProductWater, "ultraGrid1", psc, alphaNk);
- }
- }
- catch
- { }
- finally
- {
- UpdateStandPayGrid(_tabProductWater, "ultraGrid1", false);
- }
- }
- private void ToolClickComMSCStdProcess(string psc, string alphaNk, string toolKey, bool isFilted)
- {
- try
- {
- SetStandPayDeleteFilter(_tabComMSCStdProcess, "ultraCheckValid", _ckbDeleteFilter.Checked);
- UpdateStandPayGrid(_tabComMSCStdProcess, "ultraGrid1", true);
- _frmComMSCStdProcess.StdCode = alphaNk;
- _frmComMSCStdProcess.ToolBar_Click(null, toolKey);
- if (isFilted)
- {
- StandPayRowFilter(_tabComMSCStdProcess, "ultraGrid1", psc, alphaNk);
- }
- }
- catch
- { }
- finally
- {
- UpdateStandPayGrid(_tabComMSCStdProcess, "ultraGrid1", false);
- }
- }
- private void SetStandPayDeleteFilter(System.Windows.Forms.Control control, string strCheckBox, bool isCheck)
- {
- if (strCheckBox == "") return;
- System.Windows.Forms.Control[] controls = control.Controls.Find(strCheckBox, true);
- if (controls.Length > 0 && controls[0] is UltraCheckEditor)
- {
- ((UltraCheckEditor)controls[0]).Checked = isCheck;
- }
- }
- private void UpdateStandPayGrid(System.Windows.Forms.Control control, string strGrid, bool isBegin)
- {
- System.Windows.Forms.Control[] controls = control.Controls.Find(strGrid, true);
- if (controls.Length > 0 && controls[0] is UltraGrid)
- {
- if (isBegin)
- {
- ((UltraGrid)controls[0]).BeginUpdate();
- }
- else
- {
- ((UltraGrid)controls[0]).EndUpdate();
- }
- }
- }
- public void ExpandChemStandGrid()
- {
- System.Windows.Forms.Control[] controls = _tabChemStand.Controls.Find("ultraGrid1", true);
- if (controls.Length > 0 && controls[0] is UltraGrid)
- {
- UltraGrid grid = (UltraGrid)controls[0];
- if (grid.Rows.Count > 0)
- {
- grid.Rows[0].ExpandAll();
- }
- }
- }
- public void ExpandMaterialStandGrid()
- {
- System.Windows.Forms.Control[] controls = _tabMaterialStand.Controls.Find("ultraGrid1", true);
- if (controls.Length > 0 && controls[0] is UltraGrid)
- {
- UltraGrid grid = (UltraGrid)controls[0];
- if (grid.Rows.Count > 0)
- {
- grid.Rows[0].ExpandAll();
- }
- }
- }
- public void ExpandTolerancesStandGrid()
- {
- System.Windows.Forms.Control[] controls = _tabTolerancesStand.Controls.Find("ultraGrid1", true);
- if (controls.Length > 0 && controls[0] is UltraGrid)
- {
- UltraGrid grid = (UltraGrid)controls[0];
- if (grid.Rows.Count > 0)
- {
- grid.Rows[0].ExpandAll();
- }
- }
- }
- public void ExpandComMSCStdDetectionGrid()
- {
- System.Windows.Forms.Control[] controls = _tabComMSCStdDetection.Controls.Find("ultraGrid1", true);
- if (controls.Length > 0 && controls[0] is UltraGrid)
- {
- UltraGrid grid = (UltraGrid)controls[0];
- if (grid.Rows.Count > 0)
- {
- grid.Rows[0].ExpandAll();
- }
- }
- }
- public void ExpandProductWaterGrid()
- {
- System.Windows.Forms.Control[] controls = _tabProductWater.Controls.Find("ultraGrid1", true);
- if (controls.Length > 0 && controls[0] is UltraGrid)
- {
- UltraGrid grid = (UltraGrid)controls[0];
- if (grid.Rows.Count > 0)
- {
- grid.Rows[0].ExpandAll();
- }
- }
- }
- public void ExpandComMSCStdProcess()
- {
- System.Windows.Forms.Control[] controls = _tabComMSCStdProcess.Controls.Find("ultraGrid1", true);
- if (controls.Length > 0 && controls[0] is UltraGrid)
- {
- UltraGrid grid = (UltraGrid)controls[0];
- if (grid.Rows.Count > 0)
- {
- grid.Rows[0].ExpandAll();
- }
- }
- }
- public void SetChemStandMscCondition(string msc, string codeJg)
- {
- _frmChemStand.Msc = msc;
- _frmChemStand.CodeJg = codeJg;
- }
- public void SetMaterialStandardCondition(string msc, string codeJg)
- {
- _frmMaterialStand.Msc = msc;
- _frmMaterialStand.CodeJg = codeJg;
- }
- public void SetComMSCStdDetectionCondition(string msc, string codeJg)
- {
- _frmComMSCStdDetection.Msc = msc;
- _frmComMSCStdDetection.CodeJg = codeJg;
- }
- public void SetTolerancesStandardCondition(string msc, string codeJg)
- {
- _frmTolerancesStand.Msc = msc;
- _frmTolerancesStand.CodeJg = codeJg;
- }
- public void SetWaterPressureStandCondition(string msc, string codeJg)
- {
- _frmProductWater.Msc = msc;
- _frmProductWater.CodeJg = codeJg;
- }
- public void SetComMSCStdProcessCondition(string msc, string codeJg)
- {
- _frmComMSCStdProcess.Msc = msc;
- _frmComMSCStdProcess.CodeJg = codeJg;
- }
- public void SetIcContidition(string ic, string standPayKey)
- {
- switch (standPayKey)
- {
- case "ChemStand":
- _frmChemStand.Cic = ic;
- break;
- case "ComMSCStdDetection":
- _frmComMSCStdDetection.Dic = ic;
- break;
- case "ProductWater":
- _frmProductWater.WIC = ic;
- break;
- case "TolerancesStand":
- _frmTolerancesStand.Sic = ic;
- break;
- case "MaterialStand":
- _frmMaterialStand.StrPic = ic;
- break;
- case "ComMSCStdProcess":
- _frmComMSCStdProcess.Gic = ic;
- break;
- }
- }
- private void SetMaterialStandCheckBoxChecked()
- {
- //Control[] controls = _tabMaterialStand.fin
- }
- private void StandPayRowFilter(System.Windows.Forms.Control control, string strGrid, string psc, string alpha)
- {
- //if (_parentUltraGrid != null && _parentUltraGrid.ActiveRow == null) return;
- //Control[] controls = control.Controls.Find(strGrid, true);
- //if (controls.Length > 0)
- //{
- // DataSet ds = (DataSet)((UltraGrid)controls[0]).DataSource;
- // DataTable dt = ds.Tables[((UltraGrid)controls[0]).DataMember];
- // if (dt.Columns.Contains("MSC"))
- // {
- // DataRow[] drs = null;
- // if(alpha == "")
- // {
- // drs = dt.Select("MSC <> '" + psc + "' OR PSC IS NULL");
- // }
- // else
- // {
- // //STD_CODE
- // if (dt.Columns.Contains("STD_CODE_NK"))
- // {
- // drs = dt.Select("STD_CODE_NK <> '" + alpha + "' OR STD_CODE_NK IS NULL");
- // }
- // else
- // {
- // drs = dt.Select("STD_CODE <> '" + alpha + "' OR STD_CODE IS NULL");
- // }
- // }
- // foreach (DataRow dr in drs)
- // {
- // dr.Delete();
- // }
- // dt.AcceptChanges();
- // }
- //}
- }
- }
- }
|