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 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 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 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 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 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 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 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 ((AdminRegDoctorForm.IsVisible && AdminDoctorSpecialization.Text.Length <= 0)) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Specialization 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 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 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 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 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 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 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 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 bool ValidateHospitalMobilePhone() { if (MobilePhone.Text.ToString().Length <= 0 || MobilePhone.Text.ToString().All(c => char.IsWhiteSpace(c))) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Hospital Mobile Phone cannot be empty!"); return(false); } else if (!MobilePhone.Text.ToString().All(c => char.IsDigit(c))) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Hospital Mobile phone can contain only digts!"); return(false); } return(true); }
private bool ValidateReason() { if ((DoctorReservationForm.IsVisible && DoctorReason.Text.Length <= 0) || (HospitalReservationForm.IsVisible && HospitalReason.Text.Length <= 0)) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Reservation Reason cannot be empty!"); return(false); } else if ((DoctorReservationForm.IsVisible && DoctorReason.Text.ToString().All(c => char.IsDigit(c))) || (HospitalReservationForm.IsVisible && HospitalReason.Text.ToString().All(c => char.IsDigit(c)))) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Reservation Reason cannot contain digts!"); return(false); } return(true); }
private bool ValidateDiagnose() { if ((DoctorPSForm.IsVisible && DoctorPSDiagnose.Text.Length <= 0) || (HospitalPSForm.IsVisible && HospitalPSDiagnose.Text.Length <= 0)) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Visitation Diagnose cannot be empty!"); return(false); } else if ((DoctorPSForm.IsVisible && DoctorPSDiagnose.Text.ToString().All(c => char.IsDigit(c))) || (HospitalPSForm.IsVisible && HospitalPSDiagnose.Text.ToString().All(c => char.IsDigit(c)))) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Visitation Diagnose cannot contain digts!"); 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); }
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 ValidateHospitalOwner() { if (Owner.Text.Length > 255) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Hospital Owner cannot be more than 255 characters!"); return(false); } else if (Owner.Text.ToString().All(c => char.IsDigit(c))) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Hospital Owner cannot contain digits!"); return(false); } return(true); }
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 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 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 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 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 bool ValidateHospitalAddress() { if (Address.Text.Length > 255) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Hospital Address cannot be more than 255 characters!"); return(false); } else if (Address.Text.Length <= 0 || Address.Text.ToString().All(c => char.IsWhiteSpace(c))) { MessageForm MessageForm = new MessageForm("Wrong Data Input", "The Hospital Address cannot be empty!"); return(false); } return(true); }
private bool ValidatePatientEGN() { if (Egn.Text.ToString().Length != 10) { MessageBox.ShowMessageBoxError("Wrong Data Input", "The Doctor's EGN should be excatly 10 digits!"); return(false); } else if (!Egn.Text.ToString().All(c => char.IsDigit(c))) { MessageBox.ShowMessageBoxInfo("Wrong Data Input", "The Doctor's EGN should contains only digts!"); return(false); } return(true); }