示例#1
0
 private void tsmiShowTestControl_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.TestUserControl);
 }
示例#2
0
 private void tsmiEditCurrentModel_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.ModelEdit);
 }
示例#3
0
 private void tsmiMarkerTypes_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.MarkerTypeCRUD);
 }
示例#4
0
 private void tsmiCreateNewModel_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.ModelNew);
 }
示例#5
0
 private void pbElectoralCycle_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.ElectoralCycle);
 }
示例#6
0
 private void tsmiModifyExistingUser_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.UserModify);
 }
示例#7
0
 private void tsmiViewFactors_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.KnowledgeResources);
 }
示例#8
0
 private void tsmiChangePassword_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.UserResetPassword);
 }
示例#9
0
 private void tsmiModifyFactor_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.FactorModify);
 }
示例#10
0
 private void tsmiReorderFactors_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.FactorReorder);
 }
示例#11
0
 private void pbRiskMapping_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.RiskMapping);
 }
示例#12
0
 private void tsmiAbout_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.About);
 }
示例#13
0
 private void pbRiskAndAction_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.RiskActionRegister);
 }
示例#14
0
 private void tsmiReorderFactorsCurrentModel_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.ModelReorderFactors);
 }
示例#15
0
 private void tsmiModifyPhase_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.ElectoralCycleModifyPhase);
 }
示例#16
0
 private void tsmiAdminRegions_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.EditRegion);
 }
示例#17
0
 private void tsmiAddNewUser_Click(object sender, EventArgs e)
 {
     ViewManager.SetMainControl(ERMTControl.UserNew);
 }
示例#18
0
        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"));
                    }
                }
            }
        }
示例#19
0
 private void pbStart_Click(object sender, EventArgs e)
 {
     ViewManager.ShowStart();
 }