示例#1
0
 private void LoadWiz(IWizardStep step)
 {
     WizardForm wiz = new WizardForm(step, Translations.StartUpTasks);
     wiz.OnFinish = () => { };
     wiz.OnClose = () =>
     {
         CheckStatus();
     };
     wiz.ShowDialog();
 }
示例#2
0
 private void RunUpdates()
 {
     SettingsRepository repo = new SettingsRepository();
     string scriptsPath = Path.Combine(
       System.Windows.Forms.Application.StartupPath, @"DatabaseScripts\Differentials\");
     List<string> scriptsToRun = repo.GetSchemaChangeScripts(scriptsPath);
     if (scriptsToRun.Count > 0)
     {
         WizardForm wiz = new WizardForm(new UpdateDb(scriptsToRun, DoRestart), Translations.Updates);
         wiz.OnFinish += () => 
         {
             if (restartNeeded)
                 OnRestart();
         };
         wiz.ShowDialog();
     }
 }
示例#3
0
        private void Shell_Load(object sender, EventArgs e)
        {
            if (!DesignMode)
            {
                pnlLeft.Visible = false;
                DatabaseView dbView = new DatabaseView();
                dbView.OnFileSelected += dbView_OnFileSelected;
                LoadView(dbView);
                DoTranslate();
                if (ConfigurationManager.AppSettings["DeveloperMode"] == "QA")
                    lblDeveloperMode.Visible = true;

                // Updates
                if (Util.HasInternetConnection() && UpdateApp.HasUpdate())
                {
                    WizardForm wiz = new WizardForm(new UpdateApp(RestartApp), Translations.Updates);
                    wiz.OnFinish += () => { };
                    wiz.ShowDialog();
                }
            }
        }
 private void lvLevels_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e)
 {
     e.Handled = true;
     if (e.Column.AspectName == "EditText")
     {
         AdminLevelTypeAdd add = new AdminLevelTypeAdd((AdminLevelType)e.Model);
         // Tell the control if is being launched from StartUp
         add.IsStartUp = IsStartUp;
         add.OnSave += () => { RefreshList(); };
         add.ShowDialog();
     }
     else if (e.Column.AspectName == "DeleteText")
     {
         r.Delete((AdminLevelType)e.Model, ApplicationData.Instance.GetUserId());
         RefreshList();
     }
     else if (e.Column.AspectName == "ImportText")
     {
         WizardForm wiz = new WizardForm(new StepAdminLevelImport((AdminLevelType)e.Model, null, null), Translations.Import);
         wiz.OnFinish = () => { };
         wiz.OnClose = () => { };
         wiz.ShowDialog();
     }
 }
示例#5
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     WizardForm wiz = new WizardForm(new UpdateApp(OnRestart), Translations.Updates);
     wiz.OnFinish += () => { };
     wiz.ShowDialog();
 }
示例#6
0
 private void menuIndicatorManagementToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DiseaseDashboard dash = new DiseaseDashboard(true);
     dash.ReloadView = (v) => { };
     dash.LoadView = (v) => { };
     dash.LoadForm = (v) => { LoadForm(v); };
     dash.StatusChanged = (s) => { };
     WizardForm wiz = new WizardForm(new IndStepType(), Translations.MenuIndicatorManagement);
     wiz.OnFinish = import_OnSuccess;
     wiz.OnClose = () =>
     {
         LoadDashboard(new DashboardView());
     };
     wiz.ShowDialog();
 }
示例#7
0
 private void menuMergeDistrictToolStripMenuItem_Click(object sender, EventArgs e)
 {
     SettingsRepository repo = new SettingsRepository();
     DiseaseDashboard dash = new DiseaseDashboard(true);
     dash.ReloadView = (v) => { };
     dash.LoadView = (v) => { };
     dash.LoadForm = (v) => { LoadForm(v); };
     dash.StatusChanged = (s) => { };
     WizardForm wiz = new WizardForm(new BackupForRedistrict(new RedistrictingOptions { Dashboard = dash, SplitType = SplittingType.Merge }),
         Translations.SplitMergeTitle);
     wiz.OnFinish = import_OnSuccess;
     wiz.OnClose = () =>
     {
         LoadDashboard(new DashboardView());
     };
     wiz.ShowDialog();
 }
示例#8
0
 private void menuNewYearDistroToolStripMenuItem_Click(object sender, EventArgs e)
 {
     StepDdUpdateGrowthRate step = new StepDdUpdateGrowthRate();
     WizardForm wiz = new WizardForm(step, Translations.UpdateDdForYear);
     wiz.OnFinish = () => { LoadDashboard(new DashboardView()); };
     step.OnSkip = () => { wiz.Close(); };
     wiz.ShowDialog();
 }
示例#9
0
 private void LoadImporter(IImporter importer)
 {
     WizardForm wiz = new WizardForm(new ImportStepType(new ImportOptions { Importer = importer }), importer.ImportName);
     wiz.OnFinish = import_OnSuccess;
     wiz.ShowDialog();
 }
示例#10
0
        private void menuDemographyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            StepDemoLevel step = new StepDemoLevel();
            WizardForm wiz = new WizardForm(step, Translations.ImportDemo);
            wiz.OnFinish = () => { LoadDashboard(new DashboardView()); };
            step.OnSkip = () => { wiz.Close(); };
            wiz.ShowDialog();

        }
示例#11
0
 private void menuCheckForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     WizardForm wiz = new WizardForm(new UpdateApp(RestartApp), Translations.Updates);
     wiz.OnFinish += () => { };
     wiz.ShowDialog();
 }