private void tsmiShowTestControl_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.TestUserControl); }
private void tsmiEditCurrentModel_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.ModelEdit); }
private void tsmiMarkerTypes_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.MarkerTypeCRUD); }
private void tsmiCreateNewModel_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.ModelNew); }
private void pbElectoralCycle_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.ElectoralCycle); }
private void tsmiModifyExistingUser_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.UserModify); }
private void tsmiViewFactors_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.KnowledgeResources); }
private void tsmiChangePassword_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.UserResetPassword); }
private void tsmiModifyFactor_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.FactorModify); }
private void tsmiReorderFactors_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.FactorReorder); }
private void pbRiskMapping_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.RiskMapping); }
private void tsmiAbout_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.About); }
private void pbRiskAndAction_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.RiskActionRegister); }
private void tsmiReorderFactorsCurrentModel_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.ModelReorderFactors); }
private void tsmiModifyPhase_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.ElectoralCycleModifyPhase); }
private void tsmiAdminRegions_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.EditRegion); }
private void tsmiAddNewUser_Click(object sender, EventArgs e) { ViewManager.SetMainControl(ERMTControl.UserNew); }
private void tsmiImportModel_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == DialogResult.OK) { StreamReader sr = File.OpenText(openFileDialog.FileName); Document doc = new Document { Content = sr.ReadToEnd() }; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(doc.Content); int importVersion = 0; XmlNode versionNode = xmlDoc.SelectSingleNode("data/Version"); if (versionNode != null) { importVersion = int.Parse(versionNode.Attributes["Number"].Value.Substring(0, 1)); } if (importVersion == 0 || importVersion < 7) { CustomMessageBoxReturnValue customMessageBoxReturnValue = CustomMessageBox.ShowMessage(ResourceHelper.GetResourceText("RegionsMustBeLoadedBeforeImport"), CustomMessageBoxMessageType.Information, CustomMessageBoxButtonType.YesNo); if (customMessageBoxReturnValue == CustomMessageBoxReturnValue.Cancel) { return; } } List <string> message = DocumentHelper.Import(doc); if (message[0] == "true") { //import successfull. if (message.Count > 2) { if (message[1] == "SomeRegionsWereNotImported") { CustomMessageBox.ShowMessage(ResourceHelper.GetResourceText("ModelImportOk") + " " + ResourceHelper.GetResourceText("SomeRegionsWereNotImported") + ": " + message[2]); } } else { CustomMessageBox.ShowMessage(ResourceHelper.GetResourceText("ModelImportOk")); } ViewManager.ShowStart(); ViewManager.LoadModelsMenu(); } else { //import failed. if (message.Count == 1) { //it was an exception CustomMessageBox.ShowMessage(ResourceHelper.GetResourceText("ModelImportNotOk")); return; } if (message[1] == "ModelImportNoExistsRegionsInLocalDB") { CustomMessageBox.ShowMessage(ResourceHelper.GetResourceText("ModelImportNoExistsRegionsInLocalDB") + " " + ResourceHelper.GetResourceText("ModelImportNotOk")); } else if (message[1] == "ModelImportNoExistsParentRegionInLocalDB") { CustomMessageBox.ShowMessage(ResourceHelper.GetResourceText("ModelImportNoExistsParentRegionInLocalDB") + " " + ResourceHelper.GetResourceText("ModelImportNotOk")); } else if (message[1] == "ModelImportMainRegionDoesNotExits") { CustomMessageBox.ShowMessage(ResourceHelper.GetResourceText("ModelImportMainRegionDoesNotExits") + " " + ResourceHelper.GetResourceText("ModelImportNotOk")); } else if (message[1] == "ModelImportErrorVersionUsesDundasAndWrongParent") { CustomMessageBox.ShowMessage(ResourceHelper.GetResourceText("ModelImportErrorVersionUsesDundasAndWrongParent") + " " + ResourceHelper.GetResourceText("ModelImportNotOk")); } else { CustomMessageBox.ShowMessage(ResourceHelper.GetResourceText("ModelImportNotOk")); } } } }
private void pbStart_Click(object sender, EventArgs e) { ViewManager.ShowStart(); }