コード例 #1
0
        private void WalletPasswordBox_Shown(object sender, EventArgs e)
        {
            FPasswordMatch         = false;
            unlockPictureBox.Image = Properties.Resources.unlocked;

            passwordBox.Focus();
            passwordBox.Clear();
            passwordBoxCheck.Clear();
            WarningLabel.Hide();

            if (!FIsNewPassword)
            {
                firstLabel.Text = "Insert password used to decrypt wallet";
                passwordBoxCheck.Hide();
                secondLabel.Hide();
                lockPictureBock.Image = Properties.Resources.locked;
                unlockPictureBox.Hide();
                lockPictureBock.Show();
                WarningLabel.Show();
                WarningLabel.Text = "- LOCKED -";
            }
            else
            {
                firstLabel.Text = "Insert new password used to decrypt wallet";
                passwordBox.Show();
                passwordBoxCheck.Show();
                secondLabel.Show();
                lockPictureBock.Hide();
                unlockPictureBox.Show();
            }

            FPasswordMatch = false;
            btnOK.Enabled  = true;
        }
コード例 #2
0
 private void SecureSettingsShow()
 {
     ChangePassLabel.Show();
     OldPasswordTextBox.Show();
     NewPasswordTextBox.Show();
     ConfirmPasswordTextBox.Show();
     ChangeButton.Show();
     materialDivider1.Show();
     CreateKeyLabel.Show();
     SecureKeyDescLabel.Show();
     CreateKeyButton.Show();
     WarningLabel.Show();
 }
コード例 #3
0
        private bool CheckPasswordsBoxes()
        {
            if (!FIsNewPassword)
            {
                if (string.IsNullOrWhiteSpace(passwordBox.Text))
                {
                    WarningLabel.Text = "Please enter password to continue";
                    WarningLabel.Show();
                    return(false);
                }
                return(true);
            }

            if (string.IsNullOrWhiteSpace(passwordBox.Text) || string.IsNullOrWhiteSpace(passwordBoxCheck.Text))
            {
                WarningLabel.Text = "Please fill all boxes to continue";
                WarningLabel.Show();
                return(false);
            }

            if (passwordBox.Text.Length < 8)
            {
                WarningLabel.Text = "Password too short to continue. Minimum 8 characters.";
                WarningLabel.Show();
                return(false);
            }

            if (!(passwordBox.Text.Any(c => char.IsLetter(c))))
            {
                WarningLabel.Text = "Password must contain at least one letter (a-Z)\n and one digit (0-9)";
                WarningLabel.Show();
                return(false);
            }

            if (!(passwordBox.Text == passwordBoxCheck.Text))
            {
                WarningLabel.Text = "Password must match. Please verify";
                WarningLabel.Show();
                return(false);
            }

            return(true);
        }
コード例 #4
0
        public void SetResult(string aError = null)
        {
            this.SetArrowCursor();

            if (string.IsNullOrEmpty(aError))
            {
                FPasswordMatch = true;
                DialogResult   = DialogResult.OK;
                Close();
            }
            else
            {
                WarningLabel.Text = aError;
                WarningLabel.Show();
                lockPictureBock.Image = Properties.Resources.locked;
                btnOK.Enabled         = true;
            }

            Password = null;
        }
コード例 #5
0
        private void CreateDoctorButton_Click(object sender, EventArgs e)
        {
            if (DoctorLastNameTextBox.Text.Length > 0 && DoctorFirstNameTextBox.Text.Length > 0)
            {
                SqlHelper.TryInsert <Doctor>(new []
                {
                    new Doctor
                    {
                        LastName  = DoctorLastNameTextBox.Text,
                        FirstName = DoctorFirstNameTextBox.Text,
                        SurName   = DoctorSurNameTextBox.Text
                    }
                });

                ((MainForm)PForm)?.RefreshDoctorCombobox();
                Close();
            }
            else
            {
                WarningLabel.Show();
            }
        }
コード例 #6
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            FOkPressed = true;

            if (!CheckPasswordsBoxes())
            {
                return;
            }

            lockPictureBock.Image = Properties.Resources.Waiting;

            if (!FIsNewPassword)
            {
                WarningLabel.Text = "Trying to decrypt...";
                WarningLabel.Show();
            }
            else
            {
                WarningLabel.Text = "Encrypting wallet. Please Wait...";
                WarningLabel.Show();
            }

            btnOK.Enabled = false;

            Password = passwordBox.Text;

            try
            {
                OnOkButtonClick?.Invoke(sender, e);
            }
            catch (Exception ex)
            {
                this.StandardExceptionMsgBox(ex);
            }

            this.SetWaitCursor();
        }
コード例 #7
0
 private void ShowErrorMessage(string fieldName)
 {
     WarningLabel.Text = $@"Необходимо заполнить поле {fieldName}";
     WarningLabel.Show();
 }
コード例 #8
0
        private void CreatePatientButton_Click(object sender, EventArgs e)
        {
            if (IsDataCorrect())
            {
                var patientModel = new Patient
                {
                    LastName       = PatientLastNameTextBox.Text,
                    FirstName      = PatientFirstNameTextBox.Text,
                    SurName        = PatientSurNameTextBox.Text,
                    Sex            = MaleSexRadioButton.Checked ? PatientSex.Male : PatientSex.Female,
                    ParentName     = ParentFIOTextBox.Text,
                    Address        = PatientAddressTextBox.Text,
                    BirthDate      = PatientBirthDatePicker.Value,
                    GestationAge   = int.Parse(GestationAgeTextBox.Text),
                    BirthWeight    = int.Parse(BirthWeightTextBox.Text),
                    BirthHeight    = int.Parse(BirthHeightTextBox.Text),
                    BirthHeadSize  = int.Parse(BirthHeadSizeTextBox.Text),
                    BirthChestSize = int.Parse(BirthChestSizeTextBox.Text),
                    ApgarScale     = new ApgarResult
                    {
                        AfterBirth      = int.Parse(ApgarTextBox1.Text),
                        AfterOneMinute  = int.Parse(ApgarTextBox2.Text),
                        AfterFiveMinute = int.Parse(ApgarTextBox3.Text)
                    },
                    HasDisability =
                        DisabilityNoRadioButton.Checked ? NoYesRadioButtonResult.No : NoYesRadioButtonResult.Yes,
                    IsNotFirstHospitalization =
                        HospitalizationFirstTimeRadioButton.Checked
                            ? HospitalizationCount.First
                            : HospitalizationCount.NotFirst,
                    HospitalizationDate = HospitalizationDatePicker.Value,
                    ALVDuration         =
                        ALVYesRadioButton.Checked && ALVDutarionTextBox.Text.Length > 0
                            ? int.Parse(ALVDutarionTextBox.Text)
                            : 0,
                    CPAPDuration =
                        CPAPYesRadioButton.Checked && CPAPDurationTextBox.Text.Length > 0
                            ? int.Parse(CPAPDurationTextBox.Text)
                            : 0,
                    CerebralIschemia = (CerebralIschemiaDegree)CerebralIschemiaComboBox.SelectedIndex,
                    IVH = new IVHModel
                    {
                        Degree       = (IVHDegree)IVHDegreeComboBox.SelectedIndex,
                        Localization = (IVHLocalization)IVHLocalizationComboBox.SelectedIndex
                    },
                    Meningitis =
                        MeningitisNoRadioButton.Checked ? NoYesRadioButtonResult.No : NoYesRadioButtonResult.Yes,
                    Encephalitis =
                        EncephalitisNoRadioButton.Checked ? NoYesRadioButtonResult.No : NoYesRadioButtonResult.Yes,
                    ConvulsiveSyndromeDuration =
                        ConvulsiveSyndromeYesRadioButton.Checked && ConvulsiveSyndromeDurationTextBox.Text.Length > 0
                            ? int.Parse(ConvulsiveSyndromeDurationTextBox.Text)
                            : 0,
                    Sepsis             = SepsisNoRadioButton.Checked ? NoYesRadioButtonResult.No : NoYesRadioButtonResult.Yes,
                    HDN                = HDNNoRadioButton.Checked ? NoYesRadioButtonResult.No : NoYesRadioButtonResult.Yes,
                    VKDB               = VKDBNoRadioButton.Checked ? NoYesRadioButtonResult.No : NoYesRadioButtonResult.Yes,
                    Anemia             = AnemiaNoRadioButton.Checked ? NoYesRadioButtonResult.No : NoYesRadioButtonResult.Yes,
                    Hyperbilirubinemia =
                        HyperbilirubinemiaNoRadioButton.Checked ? NoYesRadioButtonResult.No : NoYesRadioButtonResult.Yes,
                    UNEC           = UNECNoRadioButton.Checked ? NoYesRadioButtonResult.No : NoYesRadioButtonResult.Yes,
                    BirthDefect    = BirthDefectTextBox.Text,
                    Surgery        = SurgeryTextBox.Text,
                    PatientHistory = PatientHistoryTextBox.Text
                };
                if (_patient != null)
                {
                    patientModel.Id = _patient.Id;
                    SqlHelper.TryUpdate <Patient>(new object[] { patientModel });
                }
                else
                {
                    SqlHelper.TryInsert <Patient>(new object[] { patientModel });
                }

                Close();
                ((MainForm)_pForm).RefreshPatientCombobox();
            }
            else
            {
                WarningLabel.Show();
            }
        }