Example #1
0
        private void wizardPage3NewParameters_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            if (checkBoxMakeBackup.Checked)
            {
                string newname = String.Format("{0}\\{1}_backup{2}", Path.GetDirectoryName(patcher.FilePath), Path.GetFileNameWithoutExtension(patcher.FilePath), Path.GetExtension(patcher.FilePath));
                patcher.SaveFileAs(newname);
            }
            if (comboBoxNewPort.SelectedIndex > 0)
            {
                patcher.PatchFile(foundedPort.OffsetInFile, (comboBoxNewPort.SelectedItem as NavitelCOMPort).Signature);
            }
            if (comboBoxNewSpeed.SelectedIndex > 0)
            {
                patcher.PatchFile(foundedSpeed.OffsetInFile, (comboBoxNewSpeed.SelectedItem as NavitelCOMSpeed).Signature);
            }

            try
            {
                patcher.SaveFile();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Navitel Patcher", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void wizardPage2_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            //Error Control before change to page3
            //reset ErrorProvider
            errorProvider1.Clear();
            //Test for empty (each control)
            if (txtOriginServer.Text.Trim() == "")
            {
                errorProvider1.SetError(txtOriginServer, "This field can't be empty!"); e.Cancel = true;
            }
            if (txtOriginDatabase.Text.Trim() == "")
            {
                errorProvider1.SetError(txtOriginDatabase, "This field can't be empty!"); e.Cancel = true;
            }
            if (optCustomAuth.Checked)
            {
                if (txtOriginUserName.Text.Trim() == "")
                {
                    errorProvider1.SetError(txtOriginUserName, "This field can't be empty!"); e.Cancel = true;
                }
                if (txtOriginPassword.Text.Trim() == "")
                {
                    errorProvider1.SetError(txtOriginPassword, "This field can't be empty!"); e.Cancel = true;
                }
            }

            //Test connection to origin database
            lblOriginStatus.Visible = true;
            if (!testOriginConnection())
            {
                e.Cancel = true;
                MessageBox.Show(SQLConn.getLastError(), "Test Connection", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            lblOriginStatus.Visible = false;
        }
Example #3
0
        private void stepSourcePage_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            if (_migrate.PanelType == PanelTypes.Unknown)
            {
                e.Cancel = true;

                MessageBox.Show("Please select panel type", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                comboSourcePanel.Focus();

                return;
            }

            if (_migrate.SourceDatabase.Provider == DatabaseProviders.Unknown)
            {
                e.Cancel = true;

                MessageBox.Show("Please select database provider", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                comboSourceDatabase.Focus();

                return;
            }

            if (!DatabaseConnectionTest)
            {
                e.Cancel = true;

                MessageBox.Show("The database connection could not be tested.", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                connectionButton.Focus();

                return;
            }
        }
Example #4
0
        private void WizardPagePlaceDevice_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            bool skip = (bool)wizardPagePlaceDevice.Tag;

            if (skip)
            {
                this.UseWaitCursor = true;
                e.Cancel           = skip;
                Task.Run(() =>
                {
                    // check please device in avia
                    utility.IniFile avia_device = new utility.IniFile(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("FDHOME"), "AVIA", "AviaDevice.ini"));
                    bool done = false;
                    while (!done)
                    {
                        string sid = avia_device.GetString("device", "sizeid", "");
                        if (!string.IsNullOrEmpty(sid))
                        {
                            done = true;
                        }
                        else
                        {
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                    this.Invoke(new Action(() => {
                        wizardPagePlaceDevice.Tag = false;
                        wizardControl1.NextPage();
                    }));
                });
            }
            else
            {
            }
        }
        private void wizardPageOptions_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            try
            {
                engine.BootMenuEntryName   = optionsBootMenuEntry.Text;
                engine.DestinationFileName = optionsFileName.Text;
                engine.EfiUsed             = optionsEFI.Checked;
                engine.Build();
                engine.Dispose();
                engine = null;
            }
#if !DEBUG
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                e.Cancel = true;
                return;
            }
#endif
            finally
            {
                Cursor = Cursors.Default;
            }
            if (MessageBox.Show("Recovery drive created.\r\nDo you want to add another image to this recovery drive?", "Recovery Drive Builder Plus", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                e.Cancel = true;
                wizardControl.NextPage(wizardPageBootStyle, true);
            }
        }
Example #6
0
        private void stepFinishPage_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            SetProgressBar();

            if (!executeTask.IsCompleted && !executeTask.IsCanceled && !executeTask.IsFaulted)
            {
                executeTask.Start();
                executeTask.ContinueWith((t) =>
                {
                    if (t.Exception != null)
                    {
                        var logMessage = String.Format("{0},{1}", t.Exception.Message, t.Exception.StackTrace);
                        System.Diagnostics.EventLog.WriteEntry("MaestroPanel", logMessage);

                        MessageBox.Show(logMessage, "", MessageBoxButtons.OK, MessageBoxIcon.Error);

                        foreach (var item in t.Exception.InnerExceptions)
                        {
                            logMessage = String.Format("{0},{1}", item.Message, item.StackTrace);
                            System.Diagnostics.EventLog.WriteEntry("MaestroPanel", logMessage);

                            MessageBox.Show(logMessage, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }

                    buttonShowLogs.Enabled = true;
                    MessageBox.Show(String.Format("Operation Completed:{0}", executeTask.Status.ToString()), "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }, TaskContinuationOptions.OnlyOnFaulted);
            }
            else
            {
                MessageBox.Show("Migration already start. Please wait.", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #7
0
 private void BasePage_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
 {
     if (radioButton1.Checked)
     {
         if ((!string.IsNullOrEmpty(SavePath.Text)) && (Directory.Exists(Path.GetDirectoryName(SavePath.Text))))
         {
             return;
         }
         //SavePath.Text = Path.GetDirectoryName(SavePath.Text);
         label6.Visible      = true;
         pictureBox1.Image   = SystemIcons.Error.ToBitmap();
         pictureBox1.Visible = true;
         e.Cancel            = true;
     }
     else
     {
         if ((!string.IsNullOrEmpty(OpenPath.Text)) && (File.Exists(OpenPath.Text)))
         {
             return;
         }
         label6.Visible      = true;
         pictureBox1.Image   = SystemIcons.Error.ToBitmap();
         pictureBox1.Visible = true;
         e.Cancel            = true;
     }
 }
Example #8
0
 private void wizardPage1_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
 {
     if (numericUpDownPort.Value <= 0)
     {
         MessageBox.Show("There must be at least one port to be monitored", "Error");
         e.Cancel = true;
     }
     else
     {
         int port_amount = (int)numericUpDownPort.Value;
         for (int i = 1; i <= port_amount; ++i)
         {
             comboBoxPickPort.Items.Add(i);
         }
         if (port_settings == null)
         {
             port_settings = new List <UT60ESerialPortSettings>(port_amount);
         }
         if (port_settings.Count > port_amount)
         {
             port_settings.RemoveRange(port_amount, port_settings.Count - port_amount);
         }
         else if (port_settings.Count < port_amount)
         {
             port_settings.AddRange(new UT60ESerialPortSettings[port_amount - port_settings.Count]);
         }
     }
 }
Example #9
0
        private void wizardPageToothColor_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            switch (comboBoxToothColorVisual.SelectedIndex)
            {
            case 0:
                diagnosticCard.VizualToothColor = VizualToothColorType.Equal;
                break;

            case 1:
                diagnosticCard.VizualToothColor = VizualToothColorType.Periodontitis;
                break;

            case 2:
                diagnosticCard.VizualToothColor = VizualToothColorType.Depulped;
                break;
            }

            switch (comboBoxToothColorInstrumental.SelectedIndex)
            {
            case 0:
                diagnosticCard.InstrumentalToothColor = InstrumentalToothColorType.Equal;
                break;

            case 1:
                diagnosticCard.InstrumentalToothColor = InstrumentalToothColorType.NotEqualVizual;
                break;

            case 2:
                diagnosticCard.InstrumentalToothColor = InstrumentalToothColorType.NotEqual;
                break;
            }
        }
 void wzrdCreateKpUserData_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
 {
     if (!m_Validations.FirstNameValid(txtFirstName.Text))
     {
         e.Cancel             = true;
         pnlFirstName.Visible = true;
     }
     else
     {
         pnlFirstName.Visible = false;
     }
     if (!m_Validations.SurnameValid(txtSurname.Text))
     {
         e.Cancel           = true;
         pnlSurname.Visible = true;
     }
     else
     {
         pnlSurname.Visible = false;
     }
     if (!m_Validations.EmailValid(txtEMail.Text))
     {
         e.Cancel         = true;
         pnlEmail.Visible = true;
     }
     else
     {
         pnlEmail.Visible = false;
     }
 }
        async void wzrdCreateKpFinish_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            progressBar1.Visible = true;
            await Task.Run(() => wzrdCreateKpFinish_CommitAsync(sender, e));

            progressBar1.Visible = false;
            wzrdCreateKeyPair.CancelButtonText = "Close";
        }
Example #12
0
        private void stepDestinationPage_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            if (String.IsNullOrEmpty(textboxApiKey.Text))
            {
                e.Cancel = true;
                MessageBox.Show("API Key cannot be null", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textboxApiKey.Focus();

                return;
            }

            if (String.IsNullOrEmpty(textHost.Text))
            {
                e.Cancel = true;
                MessageBox.Show("API Host cannot be null", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textHost.Focus();

                return;
            }

            if (String.IsNullOrEmpty(textPlanName.Text))
            {
                e.Cancel = true;
                MessageBox.Show("Default Domain Plan cannot be null", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textPlanName.Focus();

                return;
            }

            if (!ApiConnectionTest)
            {
                e.Cancel = true;

                MessageBox.Show("The API connection could not be tested. Please press test button.", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                buttonApiTest.Focus();

                return;
            }

            _migrate.Plan.Destination.ApiHost = textHost.Text;
            _migrate.Plan.Destination.ApiKey  = textboxApiKey.Text;

            int apiPort = apiDefaultApiPort;

            if (int.TryParse(textPort.Text, out apiPort))
            {
                _migrate.Plan.Destination.ApiPort = int.Parse(textPort.Text);
            }
            else
            {
                _migrate.Plan.Destination.ApiPort = apiDefaultApiPort;
            }

            _migrate.Plan.Destination.UseHttps    = checkBoxHttps.Checked;
            _migrate.Plan.Destination.DefaultPlan = textPlanName.Text;
        }
Example #13
0
        private void WizardPageResult_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            utility.IniFile avia_device = new utility.IniFile(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("FDHOME"), "AVIA", "AviaDevice.ini"));
            string          s           = avia_device.GetString("device", "device", "");

            if (string.Compare(s, "removed", true) != 0)
            {
                avia_device.WriteValue("device", "device", "removed");
                e.Cancel = true;
            }
        }
Example #14
0
 private void wizardPage2_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
 {
     foreach (var setting in port_settings)
     {
         if (setting == null)
         {
             MessageBox.Show("You must config all the ports", "Error");
             e.Cancel = true;
             return;
         }
     }
 }
        async Task wzrdCreateKpFinish_CommitAsync(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            if (string.IsNullOrEmpty(txtFolder.Text))
            {
                txtFolder.Text = AppDomain.CurrentDomain.BaseDirectory;
            }
            bool runOk = await LynxPrivacyLib.GenerateKeys.GenerateKeyRing(txtFirstName.Text + " " + txtSurname.Text + " <" + txtEMail.Text + ">",
                                                                           m_passphrase1, txtFolder.Text);

            ImportKey impKey = new ImportKey();
            int       cntP   = impKey.ImportPublicKey(txtPublicKeyname.Text, txtFolder.Text, Global.keyDb);
            int       cntS   = impKey.ImportSecretKey(txtSecretKeyname.Text, txtFolder.Text, Global.keyDb);
        }
 void wzrdCreateKpPassphrase_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
 {
     if (!m_passphrase1.SequenceEqual(m_passphrase2))
     {
         e.Cancel       = true;
         pnlPP1.Visible = true;
         pnlPP2.Visible = true;
     }
     else
     {
         pnlPP1.Visible = false;
         pnlPP2.Visible = false;
     }
 }
        private void secOptPage_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            string user = TaskDefinition.Principal.UserId;

            Password = null;
            if (TaskDefinition.Principal.LogonType == TaskLogonType.InteractiveTokenOrPassword || TaskDefinition.Principal.LogonType == TaskLogonType.Password)
            {
                Password = InvokeCredentialDialog(user);
                if (Password == null)
                {
                    MessageBox.Show(this, EditorProperties.Resources.UserAuthenticationError, null);
                    e.Cancel = true;
                }
            }
        }
Example #18
0
        private void WizardPageScanColor_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            bool skip = (bool)wizardPageScanColor.Tag;

            if (skip)
            {
                this.UseWaitCursor = true;
                Task.Run(() =>
                {
                    // get color value.
                    DateTime _start = DateTime.Now;
                    bool done       = false;
                    while (!done && (DateTime.Now - _start).TotalMinutes < 1)
                    {
                        Tuple <bool, Color> res = util.read_color();
                        if (res.Item1)
                        {
                            done = true;
                            // write color rgb to ini
                            utility.IniFile avia_device = new utility.IniFile(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("FDHOME"), "AVIA", "AviaDevice.ini"));
                            avia_device.WriteValue("device", "rgb", $"{res.Item2.R},{res.Item2.G},{res.Item2.B}");
                        }
                    }
                    if (!done)
                    {
                        //this.Invoke(new Action(() =>
                        //{
                        //    MessageBox.Show("Fail to get color, please try again.", "Error");
                        //}));
                        MessageBox.Show("Fail to get color, please try again.", "Error");
                        this.UseWaitCursor = false;
                    }
                    else
                    {
                        //System.Threading.Thread.Sleep(3000);
                        this.Invoke(new Action(() =>
                        {
                            wizardPageScanColor.Tag = false;
                            wizardControl1.NextPage();
                        }));
                    }
                });
                e.Cancel = true;
            }
            else
            {
            }
        }
Example #19
0
        private void wizardPage3_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            //Error Control before change to page4
            //reset ErrorProvider
            errorProvider1.Clear();
            //if Export to Database is selected, test upper groupbox
            if (optExportToDatabase.Checked)
            {
                //Test for empty (each control)
                if (txtDestinationServerName.Text.Trim() == "")
                {
                    errorProvider1.SetError(txtDestinationServerName, "This field can't be empty!"); e.Cancel = true;
                }
                if (txtDestinationDatabase.Text.Trim() == "")
                {
                    errorProvider1.SetError(txtDestinationDatabase, "This field can't be empty!"); e.Cancel = true;
                }
                if (txtDestinationUserName.Text.Trim() == "")
                {
                    errorProvider1.SetError(txtDestinationUserName, "This field can't be empty!"); e.Cancel = true;
                }

                if (txtDestinationPort.Text.Trim() == "")
                {
                    errorProvider1.SetError(txtDestinationPort, "This field can't be empty!"); e.Cancel = true;
                }

                //Test connection to destination server
                lblDestinationStatus.Visible = true;
                if (!testDestinationConnection())
                {
                    e.Cancel = true;
                    MessageBox.Show(MySQLConn.getLastError(), "Test Connection", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    testMySQLCase();
                }
                lblDestinationStatus.Visible = false;
            }
            else //then Export to File is selected, test lower groupbox
            {
                if (txtDestinationFolder.Text.Trim() == "")
                {
                    errorProvider1.SetError(txtDestinationFolder, "Please select a folder"); e.Cancel = true;
                }
            }
        }
Example #20
0
 private void wizardPage3_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
 {
     if (numericUpDownLimit.Value <= 0)
     {
         MessageBox.Show("Limit cannot be less than or equal to 0", "Error");
         e.Cancel = true;
     }
     else
     {
         log_setting = new UT60ELogSettings(comboBoxLimit.SelectedIndex,
                                            (int)numericUpDownLimit.Value,
                                            (int)numericUpDownFrequency.Value,
                                            filePathTextBox1.Text,
                                            dateTimePicker1.Value);
     }
 }
Example #21
0
        private void wizardPageHygieneIndex_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            //TODO: нужен enum
            switch (comboBoxHygieneIndex.SelectedIndex)
            {
            case 0:
                diagnosticCard.HygieneIndex = HygieneIndexType.val0_12;
                break;

            case 1:
                diagnosticCard.HygieneIndex = HygieneIndexType.val13_30;
                break;

            case 2:
                diagnosticCard.HygieneIndex = HygieneIndexType.val31_60;
                break;
            }

            /*
             * try
             * {
             *
             *  if (textBoxHygieneIndex.Text.Length == 0)
             *  {
             *      MessageBox.Show("Значение не должно быть пустым", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
             *      e.Cancel = true;
             *      return;
             *  }
             *
             *  double b = Convert.ToDouble(textBoxHygieneIndex.Text);
             *  if (b < 0 || b > 6)
             *  {
             *      MessageBox.Show("Значение должно быть в диапазоне от 0 до 6 баллов", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
             *      e.Cancel = true;
             *      return;
             *  }
             *  diagnosticCard.HygieneIndex = b;
             * }
             * catch
             * {
             *  MessageBox.Show("Введено некорректное значение", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
             *  e.Cancel = true;
             *  return;
             * }
             */
        }
Example #22
0
        private void wizardPageFissure_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            switch (comboBoxFissure.SelectedIndex)
            {
            case 0:
                diagnosticCard.PresenceOfFissures = FissureType.Type1;
                break;

            case 1:
                diagnosticCard.PresenceOfFissures = FissureType.Type2;
                break;

            case 2:
                diagnosticCard.PresenceOfFissures = FissureType.Type3;
                break;
            }
        }
Example #23
0
        private void wizardPageToothCrownDestruction_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            switch (comboBoxToothCrownDestruction.SelectedIndex)
            {
            case 0:
                diagnosticCard.ToothCrownDestructionIndex = ToothCrownDestructionIndexType.Class5_30percents;
                break;

            case 1:
                diagnosticCard.ToothCrownDestructionIndex = ToothCrownDestructionIndexType.Class5and6_Class_3and4_60_percents;
                break;

            case 2:
                diagnosticCard.ToothCrownDestructionIndex = ToothCrownDestructionIndexType.Class3and4and5_more_than_60_percents;
                break;
            }
        }
Example #24
0
        private void wizardPageBite_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            switch (comboBoxBite.SelectedIndex)
            {
            case 0:
                diagnosticCard.Bite = BiteType.Open;
                break;

            case 1:
                diagnosticCard.Bite = BiteType.Deep;
                break;

            case 2:
                diagnosticCard.Bite = BiteType.Other;
                break;
            }
        }
Example #25
0
        private void wizardPagePeriodontalDisease_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            switch (comboBoxPeriodontalDisease.SelectedIndex)
            {
            case 0:
                diagnosticCard.PeriodontalDisease = PeriodontalDiseaseType.Healthy;
                break;

            case 1:
                diagnosticCard.PeriodontalDisease = PeriodontalDiseaseType.Low;
                break;

            case 2:
                diagnosticCard.PeriodontalDisease = PeriodontalDiseaseType.Medium;
                break;
            }
        }
Example #26
0
        private void wizardPageBadHabits_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            switch (comboBoxBadHabits.SelectedIndex)
            {
            case 0:
                diagnosticCard.BadHabits = BadHabitsType.No;
                break;

            case 1:
                diagnosticCard.BadHabits = BadHabitsType.AnyBiting;
                break;

            case 2:
                diagnosticCard.BadHabits = BadHabitsType.Other;
                break;
            }
        }
Example #27
0
 private void WizardPageSelect_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
 {
     utility.IniFile ini = new utility.IniFile(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("FDHOME"), "AVIA", "aviaDevice.ini"));
     if (!theRect.IsEmpty)
     {
         Point p  = System.Windows.Forms.Cursor.Position;
         Point p1 = this.PointToClient(p);
         Program.logIt($"position: {p1} on N {theRect.Contains(p1)}");
         if (theRect.Contains(p1))
         {
             ini.WriteValue("override", "grade", "D");
         }
     }
     //comboBoxModels.Tag = comboBoxModels.SelectedItem;
     ini.WriteValue("device", "select", comboBoxModels.SelectedItem.ToString());
     ini.WriteValue("query", "selected", comboBoxModels.SelectedItem.ToString());
 }
Example #28
0
        private void wizardPageProfessionalHarmfulness_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            switch (comboBoxProfessionalHarmfulness.SelectedIndex)
            {
            case 0:
                diagnosticCard.OccupationalInsalubrity = OccupationalInsalubrityType.No;
                break;

            case 1:
                diagnosticCard.OccupationalInsalubrity = OccupationalInsalubrityType.WithoutPhysicalStresses;
                break;

            case 2:
                diagnosticCard.OccupationalInsalubrity = OccupationalInsalubrityType.Other;
                break;
            }
        }
Example #29
0
 private void wizardPage1_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
 {
     if (this.textBoxLastName.Text.Length == 0 || this.textBoxFirstName.Text.Length == 0 || this.textBoxSecondName.Text.Length == 0 || this.textBoxCardNumber.Text.Length == 0)
     {
         MessageBox.Show("Не заполнены обязательные поля", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
         e.Cancel = true;
     }
     else
     {
         firstName  = this.textBoxFirstName.Text;
         secondName = this.textBoxSecondName.Text;
         lastName   = this.textBoxLastName.Text;
         date       = dateTimeCreating.Value;
         birthdate  = dateTimeBirthday.Value;
         cardNumber = textBoxCardNumber.Text;
     }
 }
Example #30
0
        private void wizardPage10_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            try
            {
                var row = rr_history.Create <DiagnosticCard>(firstName, secondName, lastName,
                                                             date, rr_history.RowType.Diagnostics, diagnosticCard, birthdate, cardNumber, new byte[0]);
                RrDb db = new RrDb();
                db.Add(row);

                MessageBox.Show("Данные успешно сохранены", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Не удалось сохранить данные: " + ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                e.Cancel = true;
            }
        }