예제 #1
0
 /// <summary>
 /// Monitors combo box selection
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void GenderComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (GenderComboBox.SelectedIndex > -1)
     {
         PatientFormValidator.Clear();
     }
 }
예제 #2
0
 /// <summary>
 /// Needs to accept only numbers
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BedNo_Validating(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (String.IsNullOrEmpty(BedNoText.Text))
     {
         e.Cancel = true;
         PatientFormValidator.SetError(BedNoText, errorMsg);
     }
 }
예제 #3
0
 public PatientsViewModelFactory(
     IPatientService patientService,
     IReservationService reservationService,
     PatientFormValidator validationRules)
 {
     _patientService     = patientService;
     _reservationService = reservationService;
     _validationRules    = validationRules;
 }
예제 #4
0
        // Constructors
        #region Constructors


        // For new
        public PatientFormViewModel(IPatientService patientService,
                                    PatientFormValidator patientFormValidator)
        {
            CloseFormCommand      = new RelayCommand(CancelForm);
            _patientService       = patientService;
            _patientFormValidator = patientFormValidator;

            BirthDate = DateTime.Today;

            SubmitFormCommand = new AsyncRelayCommand(SubmitNewPatientForm, CanSubmitForm, (ex) => { throw ex; });
        }
예제 #5
0
        /// <summary>
        /// Clears all fields on form
        /// </summary>
        private void ClearAllFields()
        {
            FirstNameText.Text           = "";
            LastNameText.Text            = "";
            AddressText.Text             = "";
            GenderComboBox.SelectedIndex = -1;
            ConsultingDoctorText.Text    = "";
            WardText.Text       = "";
            RoomNoText.Text     = "";
            BedNoText.Text      = "";
            YesCheckBox.Checked = false;
            PatientFormValidator.Clear();
            HealthCardLabel.Text = "-";

            FirstNameText.Focus();
        }
예제 #6
0
        //For edit
        public PatientFormViewModel(Patient patient,
                                    IPatientService patientService,
                                    PatientFormValidator validationRules) : this(patientService, validationRules)
        {
            _patient = patient;


            LastName       = patient.LastName;
            FirstName      = patient.FirstName;
            PhoneNumber    = patient.PhoneNumber.ToString();
            Email          = patient.Email;
            Comments       = patient.Comments;
            BirthDate      = patient.BirthDate;
            PostCode       = patient.Address.PostCode;
            City           = patient.Address.City;
            Street         = patient.Address.Street;
            BuildingNumber = patient.Address.BuildingNumber;
            FlatNumber     = patient.Address.FlatNumber;

            SubmitFormCommand = new AsyncRelayCommand(SubmitEditPatientForm, CanSubmitForm, (ex) => { throw ex; });
        }