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> >()); }
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> >()); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
private bool ValidateDoctorSpecialization() { if ((AdminRegDoctorForm.IsVisible && AdminDoctorSpecialization.Text.Length <= 0)) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Specialization cannot be empty!"); return(false); } return(true); }
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); }
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())); }
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())); }
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!"); } }
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!"); } }
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!"); } }
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!"); } }
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!"); } }
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); }
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); }
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); }
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}"); } }
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); }
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); }
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); }