private void FormAssetToAttribute_FormClosed(object sender, FormClosedEventArgs e) { FormManager.RemoveAssetToAttribute(this); }
private void tsbPCIDistress_Click(object sender, EventArgs e) { FormPCIDistressManager pciDistressManager = new FormPCIDistressManager(); pciDistressManager.Show(FormManager.GetDockPanel()); }
private void FormSecurityUsers_FormClosed(object sender, FormClosedEventArgs e) { FormManager.RemoveFormSecurityUsers(); }
public void ValidateLinear() { string strMyDocumentsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); strMyDocumentsFolder += "\\RoadCare Projects\\Temp"; Directory.CreateDirectory(strMyDocumentsFolder); string strOutFile = strMyDocumentsFolder + "\\PCIValidationErrors.txt"; TextWriter tw = new StreamWriter(strOutFile); FormManager.GetOutputWindow().ClearWindow(); foreach (DataGridViewRow row in dgvPCIBulkLoad.Rows) { string strError = ""; if (!Validation.IsValidRow(row)) { if (row.Index != dgvPCIBulkLoad.Rows.Count - 1) { SetRowColor(row, Color.LightCoral); tw.WriteLine("Entire row must be entered before Bulk Loading. Row:" + row.Index.ToString() + ", " + row.Cells["ROUTES"].Value + ", " + row.Cells["BEGIN_STATION"].Value + ", " + row.Cells["END_STATION"].Value + ", " + row.Cells["SAMPLE_"].Value + ", " + row.Cells["DATE_"].Value); m_bError = true; } continue; } LRSObjectPCI lrsObjectPCI; try { lrsObjectPCI = new LRSObjectPCI(row.Cells["ROUTES"].Value.ToString(), double.Parse(row.Cells["BEGIN_STATION"].Value.ToString()), double.Parse(row.Cells["END_STATION"].Value.ToString()), row.Cells["DIRECTION"].Value.ToString(), row.Cells["SAMPLE_"].Value.ToString(), DateTime.Parse(row.Cells["DATE_"].Value.ToString()), row.Cells["METHOD_"].Value.ToString(), row.Cells["TYPE_"].Value.ToString(), double.Parse(row.Cells["AREA"].Value.ToString()), row.Cells["DISTRESS"].Value.ToString(), row.Cells["SEVERITY"].Value.ToString(), double.Parse(row.Cells["AMOUNT"].Value.ToString())); } catch //(Exception except) { tw.WriteLine("Error validating PCI Object" + row.Index.ToString() + ", " + row.Cells["ROUTES"].Value + ", " + row.Cells["BEGIN_STATION"].Value + ", " + row.Cells["END_STATION"].Value + ", " + row.Cells["SAMPLE_"].Value + ", " + row.Cells["DATE_"].Value); m_bError = true; continue; } if (!Validation.ValidateLinear((LRSObject)lrsObjectPCI, out strError)) { tw.WriteLine(strError + ", " + row.Cells["ROUTES"].Value + ", " + row.Cells["BEGIN_STATION"].Value + ", " + row.Cells["END_STATION"].Value + ", " + row.Cells["SAMPLE_"].Value + ", " + row.Cells["DATE_"].Value); m_bError = true; continue; } if (!Validation.ValidatePCIDetail(lrsObjectPCI, out strError)) { tw.WriteLine(strError + ", " + row.Cells["ROUTES"].Value + ", " + row.Cells["BEGIN_STATION"].Value + ", " + row.Cells["END_STATION"].Value + ", " + row.Cells["SAMPLE_"].Value + ", " + row.Cells["DATE_"].Value); m_bError = true; continue; } } if (m_bError) { Global.WriteOutput("Errors encountered during validation, please check error log file before continuing."); } else { Global.WriteOutput("Validation of PCI Distress complete. No errors or warnings."); } tw.Close(); }
public void ValidateSection() { string strMyDocumentsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); strMyDocumentsFolder += "\\RoadCare Projects\\Temp"; Directory.CreateDirectory(strMyDocumentsFolder); string strOutFile = strMyDocumentsFolder + "\\PCIValidationErrors.txt"; TextWriter tw = new StreamWriter(strOutFile); string strError = ""; FormManager.GetOutputWindow().ClearWindow(); SRSObjectPCI srsObjectPCI = new SRSObjectPCI(); foreach (DataGridViewRow row in dgvPCIBulkLoad.Rows) { if (row.Cells["SAMPLE_"].Value == null) { row.Cells["SAMPLE_"].Value = ""; } if (!Validation.IsValidRow(row)) { if (row.Index != dgvPCIBulkLoad.Rows.Count - 1) { tw.WriteLine("Entire row must be entered before Bulk Loading. Row:" + row.Index.ToString() + ", " + row.Cells["FACILITY"].Value + ", " + row.Cells["SECTION"].Value + ", " + row.Cells["DATE_"].Value + ", " + row.Cells["SAMPLE_"].Value); m_bError = true; } continue; } try { srsObjectPCI.Facility = row.Cells["FACILITY"].Value.ToString(); srsObjectPCI.Section = row.Cells["SECTION"].Value.ToString(); srsObjectPCI.Sample = row.Cells["SAMPLE_"].Value.ToString(); srsObjectPCI.Date = Convert.ToDateTime(row.Cells["DATE_"].Value); srsObjectPCI.Method = row.Cells["METHOD_"].Value.ToString(); srsObjectPCI.Type = row.Cells["TYPE_"].Value.ToString(); srsObjectPCI.Area = double.Parse(row.Cells["AREA"].Value.ToString()); srsObjectPCI.Distress = row.Cells["DISTRESS"].Value.ToString(); srsObjectPCI.Severity = row.Cells["SEVERITY"].Value.ToString(); srsObjectPCI.Amount = double.Parse(row.Cells["AMOUNT"].Value.ToString()); } catch (Exception except) { tw.WriteLine("Error: Validating PCI Detail object. " + except.Message + " Row:" + row.Index.ToString() + ", " + row.Cells["FACILITY"].Value + ", " + row.Cells["SECTION"].Value + ", " + row.Cells["DATE_"].Value + ", " + row.Cells["SAMPLE_"].Value); m_bError = true; continue; } if (!Validation.ValidateSection((SRSObject)srsObjectPCI, out strError)) { tw.WriteLine(strError + ", " + row.Cells["FACILITY"].Value + ", " + row.Cells["SECTION"].Value + ", " + row.Cells["DATE_"].Value + ", " + row.Cells["SAMPLE_"].Value); m_bError = true; continue; } if (!Validation.ValidatePCIDetail(srsObjectPCI, out strError)) { tw.WriteLine(strError + ", " + row.Cells["FACILITY"].Value + ", " + row.Cells["SECTION"].Value + ", " + row.Cells["DATE_"].Value + ", " + row.Cells["SAMPLE_"].Value); m_bError = true; continue; } } if (m_bError) { Global.WriteOutput("Errors encountered during validation, please check output file before continuing."); } else { Global.WriteOutput("Validation of PCI Distress complete. No errors or warnings."); } tw.Close(); }
private void FormCalculatedField_FormClosed(object sender, FormClosedEventArgs e) { FormManager.RemoveFormCalculatedField(this); }
private void FormImportShapeFile_FormClosed(object sender, FormClosedEventArgs e) { FormManager.RemoveFormImportShapeFile(this); }
private void FormRollupSegmentation_FormClosed(object sender, FormClosedEventArgs e) { FormUnload(); FormManager.RemoveFormRollupSegmentation(this); }
private void FormInvestment_FormClosed(object sender, FormClosedEventArgs e) { FormUnload(); FormManager.RemoveFormInvestment(this); }
private void FormAttributeDocument_FormClosed(object sender, FormClosedEventArgs e) { FormUnload(); FormManager.RemoveRawAttributeForm(this); }
private void AssetTab_FormClosed(object sender, FormClosedEventArgs e) { FormManager.RemoveAssetTab(this); }
private void FormSecurityPermissions_FormClosed(object sender, FormClosedEventArgs e) { FormManager.RemoveFormSecurityPermissions(); }
public FormRoadCare() { InitializeComponent(); var formLogin = new FormLogin(); //Project is now open source so removing license check. //var now = DateTime.Now; //if (now >= Global.ExactMomentWhenLicenseExpires) //{ // MessageBox.Show( // "License has expired. Please contact Applied Research Associates to renew.", // Global.BrandCaptionForMessageBoxes, // MessageBoxButtons.OK, // MessageBoxIcon.Error); // Environment.Exit(0); //} //if (now >= Global.FirstDayOfLicenseExpirationWarning) //{ // MessageBox.Show( // $"Warning: License expires {Global.LastDayOfLicense}. Please contact Applied Research Associates to renew.", // Global.BrandCaptionForMessageBoxes, // MessageBoxButtons.OK, // MessageBoxIcon.Warning); //} var strFile = ""; #if MDSHA AuthenticationResult loginAttempt = MDSHAAuthentication.Authenticate(Global.SecurityOperations); if (loginAttempt.Successful) #endif if (formLogin.ShowDialog() == DialogResult.OK) { // DBOps will use the provider to determine SQL syntax. DBOp.Provider = DBMgr.NativeConnectionParameters.Provider; // Show the Output Window m_formOutputWindow = new FormOutputWindow(); FormManager.AddOutputWindow(m_formOutputWindow); // Show the solution explorer m_solutionExplorer = new SolutionExplorer(ref dockPanelMain); m_solutionExplorer.TabText = "RoadCare Explorer"; FormManager.AddSolutionExplorer(m_solutionExplorer); String myDocumentsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); String projectsDirectory = myDocumentsFolder + "\\RoadCare Projects"; if (!Directory.Exists(projectsDirectory)) { Directory.CreateDirectory(projectsDirectory); } myDocumentsFolder += "\\RoadCare Projects\\Temp"; Settings.Default.ROADCARE_FILE_PATH = myDocumentsFolder; // Add the explution soLOLar and the output window to the main dock panel if we do not have a previous settings file. strFile = myDocumentsFolder + "\\TAB_SETTINGS.xml"; if (!File.Exists(strFile)) { m_formOutputWindow.Show(dockPanelMain, DockState.DockBottom); m_solutionExplorer.Show(dockPanelMain, DockState.DockLeft); } else { // Load the tab settings (and other user settings?) from the XML file try { DeserializeDockContent deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString); dockPanelMain.LoadFromXml(strFile, deserializeDockContent); } catch (Exception exc) { Global.WriteOutput("Error: Problem processing TAB_SETTINGS.xml file. " + exc.Message); } } if (FormManager.GetOutputWindow().Visible == false) { m_formOutputWindow.Show(dockPanelMain, DockState.DockBottom); } this.Text = "DSS RoadCare:" + DBMgr.GetNativeConnection().Database.ToString(); if (!Global.SecurityOperations.CanLoadBinaries()) { loadBinariesToolStripMenuItem.Enabled = false; } } else { m_bIsCancelled = true; #if MDSHA //MessageBox.Show( loginAttempt.Message ); #else #endif } return; }
private void FormResultsDeficient_FormClosed(object sender, FormClosedEventArgs e) { FormManager.RemoveResultsDeficientWindow(); }