private void SaveButton_Click_1(object sender, EventArgs e)
        {
            if (NameTextBox.Text == "" || DescriptionTextBox.Text == "")
            {
                WarningLabel.DissapearAfterSeconds(2);
                NameTextBox.FlickerIfEmpty();
                DescriptionTextBox.FlickerIfEmpty();
            }
            else
            {
                //DAL.Instance.CreatePlace(NameTextBox.Text, LuxeCheckBox.Checked, DescriptionTextBox.Text, image);
                Place place = (Place)PlacesComboBox.SelectedItem;
                if (NameTextBox.Text != place.Name)
                {
                    place.Name = NameTextBox.Text;
                }
                if (LuxeCheckBox.Checked != place.Luxe)
                {
                    place.Luxe = LuxeCheckBox.Checked;
                }
                if (DescriptionTextBox.Text != place.Description)
                {
                    place.Description = DescriptionTextBox.Text;
                }
                if (ImagePictureBox.BackgroundImage != place.Image)
                {
                    place.Image = ImagePictureBox.BackgroundImage;
                }


                this.Close();
            }
        }
        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;
        }
Exemplo n.º 3
0
        private void ShowWarningLabel(string text)
        {
            WarningLabel.Content = text;
            WarningLabel.BringIntoView();
            WarningLabel.Visibility = Visibility.Visible;
            //WarningLabel.Width = 150;
            //WarningLabel.Height = 40;
            WarningLabel.FontSize   = 16.0;
            WarningLabel.Background = new SolidColorBrush(Color.FromArgb(75, 170, 0, 0));

            var a = new DoubleAnimation
            {
                From         = 1.0,
                To           = 0.0,
                FillBehavior = FillBehavior.Stop,
                BeginTime    = TimeSpan.FromSeconds(2),
                Duration     = new Duration(TimeSpan.FromSeconds(0.5))
            };
            var storyboard = new Storyboard();

            storyboard.Children.Add(a);
            Storyboard.SetTarget(a, WarningLabel);
            Storyboard.SetTargetProperty(a, new PropertyPath(OpacityProperty));
            storyboard.Completed += delegate { WarningLabel.Visibility = Visibility.Collapsed; };
            storyboard.Begin();
        }//*/
        private void AddGuestButton_Click(object sender, EventArgs e)
        {
            if (FirstNameTextBox.Text == "" || LastNameTextBox.Text == "")
            {
                WarningLabel.DissapearAfterSeconds(3);

                foreach (Control control in GuestCreationPanel.Controls)
                {
                    if (control is TextBox && control.Text == "")
                    {
                        (control as CampingTextBox).Flicker();
                    }
                }
            }
            else
            {
                Guest guest = DAL.Instance.CreateGuest(FirstNameTextBox.Text, LastNameTextBox.Text, DateOfBirthPicker.Value);
                guests.Add(guest);
                ListViewItem item = new ListViewItem(new string[] { guest.GetFullName(), guest.Age.ToString() });
                this.CurrentGuests.Items.Add(item);

                FirstNameTextBox.Text   = "";
                LastNameTextBox.Text    = "";
                DateOfBirthPicker.Value = DateTime.Today.AddYears(-DAL.Instance.AverageAge);
            }
        }
Exemplo n.º 5
0
        public IHttpActionResult GetWarningLabel(int id)
        {
            var currentUser = db.Users.FirstOrDefault(x => x.Email == this.User.Identity.Name);

            if (currentUser == null)
            {
                return(NotFound());
            }

            WarningLabel warningLabel = db.WarningLabels.Find(id);

            if (warningLabel == null)
            {
                return(NotFound());
            }

            if (Tools.AnyRole(this.User, Roles.DoctorRoles) && !warningLabel.MedicalHistory.Patient.Appointments.Any(x => x.DoctorId == currentUser.UserId))
            {
                return(Content(HttpStatusCode.Forbidden, Messages.AccsesDenied));
            }
            if (this.User.IsInRole(Roles.Patient) && warningLabel.MedicalHistory.Patient.UserId != currentUser.UserId)
            {
                return(Content(HttpStatusCode.Forbidden, Messages.AccsesDenied));
            }

            return(Ok(warningLabel));
        }
Exemplo n.º 6
0
        public IHttpActionResult PutWarningLabel(int id, WarningLabel warningLabel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != warningLabel.WarningLabelId)
            {
                return(BadRequest());
            }



            db.Entry(warningLabel).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!WarningLabelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 7
0
        protected void ShowMoreInfo()
        {
            linkTop.Visible = false;

            if (this.Warning.Length > 0)
            {
                warning          = new WarningLabel();
                warning.Size     = new Size((titlePanel.Width - lblTitle.Right), 48);
                warning.Location = new Point(this.lblTitle.Right + 25, this.linkTop.Top);
                this.titlePanel.Controls.Add(warning);
            }
            int width = titlePanel.Width;

            FitControls(titlePanel);
            titlePanel.Width = width;

            // Position the controls.
            if (lblDescription.Text.Length > 0)
            {
                linkBottom.Top = lblDescription.Bottom + 1;
            }
            else
            {
                linkBottom.Top = 2;
            }
            descriptionPanel.Top     = titlePanel.Bottom + 1;
            descriptionPanel.Visible = true;

            descriptionPanel.Height = linkBottom.Bottom + 1;;
            FitControls(mainPanel);
            FitControls(this);
        }
Exemplo n.º 8
0
 private void SecureSettingsShow()
 {
     ChangePassLabel.Show();
     OldPasswordTextBox.Show();
     NewPasswordTextBox.Show();
     ConfirmPasswordTextBox.Show();
     ChangeButton.Show();
     materialDivider1.Show();
     CreateKeyLabel.Show();
     SecureKeyDescLabel.Show();
     CreateKeyButton.Show();
     WarningLabel.Show();
 }
 private void SaveButton_Click(object sender, EventArgs e)
 {
     if (NameTextBox.Text == "" || DescriptionTextBox.Text == "")
     {
         WarningLabel.DissapearAfterSeconds(2);
         NameTextBox.FlickerIfEmpty();
         DescriptionTextBox.FlickerIfEmpty();
     }
     else
     {
         DAL.Instance.CreatePlace(NameTextBox.Text, LuxeCheckBox.Checked, DescriptionTextBox.Text, image);
         this.Close();
     }
 }
Exemplo n.º 10
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (FirstNameTextBox.Text == "" || LastNameTextBox.Text == "" || EmailTextBox.Text == "" || CityTextBox.Text == "" || StreetNameTextBox.Text == "" || ZipCodeTextBox.Text == "")
            {
                WarningLabel.DissapearAfterSeconds(2);
                FirstNameTextBox.FlickerIfEmpty();
                LastNameTextBox.FlickerIfEmpty();
                EmailTextBox.FlickerIfEmpty();
                CityTextBox.FlickerIfEmpty();
                StreetNameTextBox.FlickerIfEmpty();
                ZipCodeTextBox.FlickerIfEmpty();
            }
            else
            {
                //DAL.Instance.CreatePlace(NameTextBox.Text, LuxeCheckBox.Checked, DescriptionTextBox.Text, image);
                //Place place = (Place)PlacesComboBox.SelectedItem;
                if (FirstNameTextBox.Text != customer.FirstName)
                {
                    customer.FirstName = FirstNameTextBox.Text;
                }
                if (LastNameTextBox.Text != customer.LastName)
                {
                    customer.LastName = LastNameTextBox.Text;
                }
                if (EmailTextBox.Text != customer.Email)
                {
                    customer.Email = EmailTextBox.Text;
                }
                if (CityTextBox.Text != customer.City)
                {
                    customer.City = CityTextBox.Text;
                }
                if (StreetNameTextBox.Text != customer.Street)
                {
                    customer.Street = StreetNameTextBox.Text;
                }
                if (ZipCodeTextBox.Text != customer.ZipCode)
                {
                    customer.ZipCode = ZipCodeTextBox.Text;
                }
                if (DateOfBirthPicker.Value != customer.DateOfBirth)
                {
                    customer.DateOfBirth = DateOfBirthPicker.Value;
                }


                this.Close();
            }
        }
        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);
        }
        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;
        }
Exemplo n.º 13
0
        private void OkButton_Click(object sender, EventArgs e)
        {
            if (FirstNameTextBox.Text == "" ||
                LastNameTextBox.Text == "" ||
                EmailTextBox.Text == "" ||
                CityTextBox.Text == "" ||
                StreetNameTextBox.Text == "" ||
                ZipCodeTextBox.Text == "")
            {
                WarningLabel.Visible = true;
                WarningLabel.DissapearAfterSeconds(3);

                foreach (Control control in AccountCreationPanel.Controls)
                {
                    if (control is TextBox && control.Text == "")
                    {
                        (control as CampingTextBox).Flicker(2);
                    }
                }
            }
            else
            {
                DAL.Instance.CreateCustomer(
                    FirstNameTextBox.Text,
                    LastNameTextBox.Text,
                    DateOfBirthPicker.Value,
                    EmailTextBox.Text,
                    CityTextBox.Text,
                    (int)HouseNumber.Value,
                    ZipCodeTextBox.Text,
                    StreetNameTextBox.Text);



                ResetAccountCreation();
                AccountCreatedLabel.DissapearAfterSeconds(4);

                RefreshAccountList();
            }
        }
Exemplo n.º 14
0
        protected void HideMoreInfo()
        {
            if (warning != null)
            {
                warning.Visible = false;
                if (titlePanel.Controls.Contains(warning))
                {
                    titlePanel.Controls.Remove(warning);
                }
                warning = null;
            }

            UpdateInfoEnabled();

            lblTitle.Top         = linkTop.Top;
            this.titlePanel.Size = new Size(titlePanel.Width, lblTitle.Bottom + lblTitle.Top);

            descriptionPanel.Visible = false;

            FitControls(mainPanel);
            FitControls(this);
        }
Exemplo n.º 15
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();
            }
        }
Exemplo n.º 16
0
        public IHttpActionResult PostWarningLabel(WarningLabel warningLabel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var currentUser = db.Users.FirstOrDefault(x => x.Email == this.User.Identity.Name);
            var medHist     = db.MedicalHistorys.Find(warningLabel.MedicalHistoryId);

            if (currentUser == null)
            {
                return(NotFound());
            }
            if (medHist == null || !medHist.Patient.Appointments.Any(x => x.DoctorId == currentUser.UserId))
            {
                return(Content(HttpStatusCode.Forbidden, Messages.AccsesDenied));
            }

            db.WarningLabels.Add(warningLabel);
            db.SaveChanges();

            return(Ok(new { warningLabel.Description, warningLabel.WarningLabelId, warningLabel.MedicalHistoryId }));
        }
        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();
        }
Exemplo n.º 18
0
 private void ShowErrorMessage(string fieldName)
 {
     WarningLabel.Text = $@"Необходимо заполнить поле {fieldName}";
     WarningLabel.Show();
 }
Exemplo n.º 19
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();
            }
        }