public IGenFormsMain(IGenFormsMain oldObject) { try { // copy the passed object to this object // copy the base properties this.currentFormName = oldObject.currentFormName; this.dataset = oldObject.dataset; this.dataSource = oldObject.dataSource; this.fileName = oldObject.fileName; this.formGroupName = oldObject.formGroupName; this.name = oldObject.name; this.sql = oldObject.sql; this.visible = oldObject.visible; // now copy the sub class objects } catch (Exception ex) { CommonRoutines.DisplayErrorMessage("$E:" + moduleName + ".IGenFormsMain(o) > " + ex.Message); } return; }
public string GenerateForms() { string _results = ""; try { // set the variables // check the connection string and dbms if (connectionString == "" || connectionDBMS == "") { _results = "No connection string has been specified, please choose a connection and rerun"; CommonRoutines.DisplayErrorMessage(_results); return _results; } // display the "In process" window IGenFormCommonRoutines.connectionString = connectionString; IGenFormCommonRoutines.connectionDBMS = connectionDBMS; DatabaseRoutines.BaseConnection = baseConnectionString; DatabaseRoutines.BaseDBMS = baseConnectionDBMS; DatabaseRoutines.MainConnection = connectionString; DatabaseRoutines.MainDBMS = connectionDBMS; // bring up the viewer IGenFormsMain _igenForms = new IGenFormsMain(); IGenFormCommonRoutines.currentIGenForms = _igenForms; CommonRoutines.currentFormsPath = formFilesFolder; CommonRoutines.currentFormImagesPath = formImagesFolder; _igenForms.dataSource = connectionString; string _formFileName = formFilesFolder + "\\" + formFileName; _igenForms.formGroupName = formGroup; IGenFormCommonRoutines.currentIGenForms.fileName = formFilesFolder + "\\" + formFileName; IGenFormCommonRoutines.currentIGenForm = null; _igenForms.xmlRecs = XmlRecs; _igenForms.sql = formSQL; // load the form group _igenForms.Execute(); } catch (Exception ex) { CommonRoutines.DisplayErrorMessage("$E:" + moduleName + ".GenerateForms > " + ex.Message); } return _results; }
/// <summary> /// void InitializeApp() /// Initialize the app /// </summary> private void InitializeApp() { string _name = ""; string _value = ""; try { // set the viewer version this.Text = "IGenForms Viewer Version " + CommonRoutines.strVersion; // set events for the form this.Resize += new EventHandler(frmViewer_Resize); this.FormClosing += frmViewer_FormClosing; // add the navigation button events tbrMainFirstPage.Click += new EventHandler(btnFirst_Click); tbrMainPreviousPage.Click += new EventHandler(btnPrevious_Click); tbrMainNextPage.Click += new EventHandler(btnNext_Click); tbrMainLastPage.Click += new EventHandler(btnLast_Click); tbrMainGotoPage.Click += new EventHandler(btnGoto_Click); // set the tab select event tabForms.Selected += new TabControlEventHandler(tabForms_Selected); tabForms.MouseDown += new MouseEventHandler(TabClick); tabForms.DoubleClick += new EventHandler(tabForms_DoubleClick); tabForms.TabPages.Clear(); IGenFormCommonRoutines.runMode = true; // create a new forms object displayIGenForms = IGenFormCommonRoutines.currentIGenForms; displayIGenForms.cancelFlag = false; tbrMainStop.Visible = false; // get the last calced date SetLastDatePrepared(); tbrMainProgress.Visible = false; displayIGenForms.progressBar = tbrMainProgress; displayIGenForms.progressPercentage = tbrMainPercentage; tbrMainLastDatePrepared.Visible = false; ResizeControls(); } catch (Exception ex) { CommonRoutines.DisplayErrorMessage("$E:" + moduleName + ".InitializeApp > " + ex.Message); } DisplayStatus("Ready"); return; }