private ObservableCollection <Patient> GETAllPatientsRequest(string BasicAuthentication)
 {
     return(HttpRequest.Of($"https://localhost:44348/api/patients", RequestType.GET)
            .BasicAuthentication(BasicAuthentication)
            .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", ""))
            .Execute()
            .DeserializeBody <ObservableCollection <Patient> >());
 }
Example #2
0
 private Doctor GETDoctorInfoRequest(string param, string BasicAuthentication)
 {
     return(HttpRequest.Of($"https://localhost:44348/api/doctors/{param}", RequestType.GET)
            .BasicAuthentication(BasicAuthentication)
            .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", ""))
            .Execute()
            .DeserializeBody <Doctor>());
 }
 private List <string> GetDoctorsForHospital(string BasicAuthentication, string hospitalId)
 {
     return(HttpRequest.Of($"https://localhost:44348/api/hospitals/{hospitalId}/doctors", RequestType.GET)
            .BasicAuthentication(BasicAuthentication)
            .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", ""))
            .Execute()
            .DeserializeBody <List <string> >());
 }
Example #4
0
 private bool ValidateReservationDate()
 {
     if ((DoctorReservationForm.IsVisible && DoctorReservationDate.SelectedDate == null) || (HospitalReservationForm.IsVisible && HospitalReservationDate.SelectedDate == null))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Reservation Date cannot be empty!");
         return(false);
     }
     return(true);
 }
Example #5
0
 private ObservableCollection <Visit> GETDoctorVisitsRequest(string BasicAuthentication)
 {
     VisitList = HttpRequest.Of($"https://localhost:44348/api/visits", RequestType.GET)
                 .BasicAuthentication(BasicAuthentication)
                 .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", ""))
                 .Execute()
                 .DeserializeBody <ObservableCollection <Visit> >();
     return(VisitList);
 }
Example #6
0
 private bool ValidateReservationHospital()
 {
     if (DoctorReservationHospital.Text.Length <= 0 && DoctorReservationForm.IsVisible)
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Reservation Hospital cannot be empty!");
         return(false);
     }
     return(true);
 }
Example #7
0
 private bool ValidatePatientAddress()
 {
     if (Address.Text.ToString().Length <= 0)
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Doctor's Address cannot be empty!");
         return(false);
     }
     return(true);
 }
 private bool ValidatePSTime()
 {
     if ((DoctorPSForm.IsVisible && DoctorPSTime.SelectedTime == null) || (HospitalPSForm.IsVisible && HospitalPSTime.SelectedTime == null))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Visitation Time cannot be empty!");
         return(false);
     }
     return(true);
 }
 private bool ValidatePSDoctor()
 {
     if (HospitalPSDoctor.Text.Length <= 0 && HospitalPSForm.IsVisible)
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Visitation Doctor cannot be empty!");
         return(false);
     }
     return(true);
 }
Example #10
0
 private bool ValidateDoctorSpecialization()
 {
     if (Specialization.Text.ToString().Length <= 0)
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Doctor's Specialization cannot be empty!");
         return(false);
     }
     return(true);
 }
 private bool ValidatePSPatient()
 {
     if ((DoctorPSForm.IsVisible && DoctorPSPatient.Text.Length <= 0) || (HospitalPSForm.IsVisible && HospitalPSPatient.Text.Length <= 0))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Visitation Patient cannot be empty!");
         return(false);
     }
     return(true);
 }
Example #12
0
 private bool ValidateTime()
 {
     if ((DoctorPatientVisitForm.IsVisible && DoctorVisitTime.SelectedTime == null) || (DoctorReservationsForm.IsVisible && DoctorReservationTime.SelectedTime == null) || (HospitalPatientForm.IsVisible && HospitalPatientTime.SelectedTime == null) ||
         (HospitalReservationForm.IsVisible && HospitalReservationTime.SelectedTime == null) || (PatientReservationsForm.IsVisible && PatientReservationsTime.SelectedTime == null))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Time cannot be empty!");
         return(false);
     }
     return(true);
 }
Example #13
0
        private bool ValidateHospitalOwner()
        {
            if ((AdminRegHospitalForm.IsVisible && AdminHospitalOwner.Text.Length <= 0))
            {
                MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Hospital Owner cannot be empty!");
                return(false);
            }

            return(true);
        }
Example #14
0
        private bool ValidateDoctorSpecialization()
        {
            if ((AdminRegDoctorForm.IsVisible && AdminDoctorSpecialization.Text.Length <= 0))
            {
                MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Specialization cannot be empty!");
                return(false);
            }

            return(true);
        }
Example #15
0
        private bool ValidateAddress()
        {
            if ((AdminRegPatientForm.IsVisible && AdminPatientAddress.Text.Length <= 0) || (AdminRegDoctorRecord.IsVisible && AdminDoctorAddress.Text.Length <= 0) || (AdminRegHospitalForm.IsVisible && AdminHospitalAddress.Text.Length <= 0))
            {
                MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Address cannot be empty!");
                return(false);
            }

            return(true);
        }
Example #16
0
        private bool ValidateDoctorSpecialization()
        {
            if (Specialization.Text.Length <= 0)
            {
                MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Specialization cannot be more or less than 10 digits!");
                return(false);
            }

            return(true);
        }
 private ObservableCollection <Hospital> GETAllHospitalsRequest(string BasicAuthentication)
 {
     return(new ObservableCollection <Hospital>(HttpRequest.Of($"https://localhost:44348/api/hospitals", RequestType.GET)
                                                .BasicAuthentication(BasicAuthentication)
                                                .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", ""))
                                                .Execute()
                                                .DeserializeBody <ObservableCollection <Hospital> >()
                                                .Where(hospital => GetDoctorsForHospital(BasicAuthentication, hospital.Guid).Contains(User.Guid))
                                                .ToList()));
 }
Example #18
0
        private ObservableCollection <Doctor> GETAllDoctorsRequest(string BasicAuthentication)
        {
            var Doctors = HttpRequest.Of($"https://localhost:44348/api/doctors", RequestType.GET)
                          .BasicAuthentication(BasicAuthentication)
                          .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", ""))
                          .Execute()
                          .DeserializeBody <List <Doctor> >();
            var doctorsForHospital = GetDoctorsForHospital(User.Guid, BasicAuthentication);

            return(new ObservableCollection <Doctor>(Doctors.Where(doctor => doctorsForHospital.Contains(doctor.Guid)).ToList()));
        }
Example #19
0
        private void DELETEHospitalRequest(string BasicAuthentication, string Guid)
        {
            var httpResponse = HttpRequest.Of($"https://localhost:44348/api/hospitals/{Guid}", RequestType.DELETE)
                               .BasicAuthentication(BasicAuthentication)
                               .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", ""))
                               .Execute();

            if (httpResponse.IsSuccessful())
            {
                MessageBox.ShowMessageBoxInfo("Deleting Info Message", "The Hospital was successfully deleted!");
            }
        }
Example #20
0
        private void PUTDoctorInfoRequest(string param, string BasicAuthentication)
        {
            var response = HttpRequest.Of($"https://localhost:44348/api/doctors/{param}", RequestType.PUT)
                           .BasicAuthentication(BasicAuthentication)
                           .BodyData(Doctor)
                           .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", "Updating of the Doctor Info cannot be done!"))
                           .Execute();

            if (response != null)
            {
                MessageBox.ShowMessageBoxInfo("Doctor Update Info", "Doctor Information was updated successfully!");
            }
        }
Example #21
0
        private void PUTHospitalRequest(string BasicAuthentication, string Guid, JObject Hospital)
        {
            var httpResponse = HttpRequest.Of($"https://localhost:44348/api/hospitals/{Guid}", RequestType.PUT)
                               .BasicAuthentication(BasicAuthentication)
                               .BodyData(Hospital)
                               .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", ""))
                               .Execute();

            if (httpResponse.IsSuccessful())
            {
                MessageBox.ShowMessageBoxInfo("Updating Info Message", "The Hospital was successfully updated!");
            }
        }
Example #22
0
        private void PUTHospitalInfoRequest(string hospitalId, string BasicAuthentication)
        {
            var httpResponse = HttpRequest.Of($"https://localhost:44348/api/hospitals/{hospitalId}", RequestType.PUT)
                               .BasicAuthentication(BasicAuthentication)
                               .BodyData(HospitalObject)
                               .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", "Updating of the Hospital Info cannot be done!"))
                               .Execute();

            if (httpResponse.IsSuccessful())
            {
                MessageBox.ShowMessageBoxInfo("Hospital Update Info", "Hospital Information was updated successfully!");
            }
        }
Example #23
0
        private void POSTDoctorInfoRequest(string param, string BasicAuthentication, Doctor Doctor)
        {
            var httpResponse = HttpRequest.Of($"https://localhost:44348/api/hospitals/{param}/doctors", RequestType.POST)
                               .BasicAuthentication(BasicAuthentication)
                               .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", "Adding of Doctor cannot be done!"))
                               .BodyData(Doctor.Guid)
                               .Execute();

            if (httpResponse.IsSuccessful())
            {
                MessageBox.ShowMessageBoxInfo("Doctor Creation Info", "The Doctor was added successfully!");
            }
        }
Example #24
0
 private bool ValidateMobilePhone()
 {
     if ((AdminRegPatientForm.IsVisible && AdminPatientMobilePhone.Text.Length != 10) || (AdminRegDoctorForm.IsVisible && AdminDoctorMobilePhone.Text.Length != 10) || (AdminRegHospitalForm.IsVisible && AdminHospitalMobilePhone.Text.Length != 10))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Mobile Phone cannot be more or less than 10 digits!");
         return(false);
     }
     else if ((AdminRegPatientForm.IsVisible && !AdminPatientMobilePhone.Text.ToString().All(c => char.IsDigit(c))) || (AdminRegDoctorForm.IsVisible && !AdminDoctorMobilePhone.Text.ToString().All(c => char.IsDigit(c))) || (AdminRegHospitalForm.IsVisible && !AdminHospitalMobilePhone.Text.ToString().All(c => char.IsDigit(c))))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Mobile Phone can contain only digits!");
         return(false);
     }
     return(true);
 }
Example #25
0
 private bool ValidatePatientMobilePhone()
 {
     if (MobilePhone.Text.Length != 10)
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Mobile Phone cannot be more or less than 10 digits!");
         return(false);
     }
     else if (!MobilePhone.Text.ToString().All(c => char.IsDigit(c)))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Mobile Phone can contain only digits!");
         return(false);
     }
     return(true);
 }
Example #26
0
 private bool ValidatePatientAge()
 {
     if (Age.Text.Length > 3 || Age.Text.Length < 1)
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Age cannot be more that 3 or less than 1 digits!");
         return(false);
     }
     else if (!Age.Text.ToString().All(c => char.IsDigit(c)))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Age can contain only digits!");
         return(false);
     }
     return(true);
 }
Example #27
0
        private void POSTPatientRequest(string BasicAuthentication, JObject Patient)
        {
            var newCreatedUser = HttpRequest.Of("https://localhost:44348/api/patients", RequestType.POST)
                                 .BasicAuthentication(BasicAuthentication)
                                 .BodyData(Patient)
                                 .OnError(MessageBox.ShowMessageBoxError("Warning Data Input", ""))
                                 .Execute()
                                 .DeserializeBody <NewCreatedUser>();

            if (newCreatedUser != null)
            {
                MessageBox.ShowMessageBoxInfo("Patient Registration Info", $"Username:{newCreatedUser.Username}\nPassword:{newCreatedUser.Password}");
            }
        }
Example #28
0
 private bool ValidateAge()
 {
     if ((AdminRegPatientForm.IsVisible && (AdminPatientAge.Text.Length > 3 || AdminPatientAge.Text.Length < 1)) || (AdminRegDoctorForm.IsVisible))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Age cannot be more that 3 or less than 1 digits!");
         return(false);
     }
     else if ((AdminRegPatientForm.IsVisible && !AdminPatientAge.Text.ToString().All(c => char.IsDigit(c))) || (AdminRegDoctorForm.IsVisible))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Age can contain only digits!");
         return(false);
     }
     return(true);
 }
Example #29
0
 private bool ValidatePatientFirstName()
 {
     if (Name.Text.Length == 0)
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The First Name is required field and cannot be empty!");
         return(false);
     }
     else if (Name.Text.ToString().All(c => char.IsDigit(c)))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The First Name cannot contain digits!");
         return(false);
     }
     return(true);
 }
Example #30
0
 private bool ValidateLastName()
 {
     if ((AdminRegPatientForm.IsVisible && AdminPatientFamilyName.Text.Length == 0) || (AdminRegDoctorForm.IsVisible && AdminDoctorFamilyName.Text.Length == 0))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Last Name is required field and cannot be empty!");
         return(false);
     }
     else if ((AdminRegPatientForm.IsVisible && AdminPatientFamilyName.Text.ToString().All(c => char.IsDigit(c))) || (AdminRegDoctorForm.IsVisible && AdminPatientFamilyName.Text.ToString().All(c => char.IsDigit(c))))
     {
         MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Last Name cannot contain digits!");
         return(false);
     }
     return(true);
 }