private DataTable GetTanDetailsTableFromActiveForm(out string tan_out, out string srcCntrl_out) { DataTable dtTanDetails = null; string strTanNumber = ""; string strSrcCntrl = ""; try { frmCurator objfrmCurator = null; Forms.frmQryDuplicates objfrmQueryDups = null; Enumeration.frmRGrpEnum objfrmEnum = null; Form objActiveForm = this.ActiveMdiChild; if (objActiveForm != null) { if (objActiveForm.Name.ToUpper() == "FRMCURATOR") { objfrmCurator = (frmCurator)objActiveForm; dtTanDetails = objfrmCurator.TANDetailsTbl; strTanNumber = objfrmCurator.TANNumber; strSrcCntrl = "FRMCURATOR"; } else if (objActiveForm.Name.ToUpper() == "FRMQRYDUPLICATES") { objfrmQueryDups = (Forms.frmQryDuplicates)objActiveForm; dtTanDetails = objfrmQueryDups.ucCheckDuplicates1.SearchResults; strTanNumber = objfrmQueryDups.ucCheckDuplicates1.TANNumber; strSrcCntrl = "FRMQRYDUPLICATES"; } else if (objActiveForm.Name.ToUpper() == "FRMRGRPENUM") { objfrmEnum = (Enumeration.frmRGrpEnum)objActiveForm; dtTanDetails = objfrmEnum.EnumResultsTbl; strTanNumber = objfrmEnum.TANNumber; string strPageNo = objfrmEnum.PageNumber; string strPageLabel = objfrmEnum.PageLabel; string strExampleNo = objfrmEnum.ExampleNumber; string strTableNo = objfrmEnum.TableNumber; strSrcCntrl = "FRMRGRPENUM"; RebuildTANDetailsTable_Enum(ref dtTanDetails, strPageNo, strPageLabel, strExampleNo, strTableNo); } tan_out = strTanNumber; srcCntrl_out = strSrcCntrl; return(dtTanDetails); } } catch (Exception ex) { PepsiLiteErrorHandling.WriteErrorLog(ex.ToString()); } tan_out = strTanNumber; srcCntrl_out = strSrcCntrl; return(dtTanDetails); }
private void rGroupToolStripMenuItem_Click(object sender, EventArgs e) { try { FormCollection frmColl = Application.OpenForms; Enumeration.frmRGrpEnum objRgrpEnum = null; bool blFrmOpen = false; foreach (Form frm in frmColl) { if (frm.Name.ToUpper() == "FRMRGRPENUM") { objRgrpEnum = (Enumeration.frmRGrpEnum)frm; blFrmOpen = true; objRgrpEnum.Show(); objRgrpEnum.WindowState = FormWindowState.Maximized; } } if (!blFrmOpen) { objRgrpEnum = new Enumeration.frmRGrpEnum(); objRgrpEnum.MdiParent = this; objRgrpEnum.Show(); } } catch (Exception ex) { PepsiLiteErrorHandling.WriteErrorLog(ex.ToString()); } }