public bool AppointmentBooking(string pfirstName, string plastName, string dfirstName, string dlastName, DateTime appoitmentDateAndTime, string clinicName) { ClinicalDatabaseDataContext dc = new ClinicalDatabaseDataContext(); Appointment ap = new Appointment(); if (this.GetPatientInfo(pfirstName, plastName) == null || this.GetDoctorInfo(dfirstName, dlastName) == null) { return(false); } else { ap.insuranceNo = this.GetPatientInfo(pfirstName, plastName).insuranceNo; ap.registrationNo = this.GetDoctorInfo(dfirstName, dlastName).registrationNo; ap.datetime = appoitmentDateAndTime; ap.clinicname = clinicName; try { dc.Appointments.InsertOnSubmit(ap); dc.SubmitChanges(); } catch (Exception e) { Console.WriteLine(e.Message); throw e; } return(true); } }
public bool AppointmentReschedule(string pfirstName, string plastName, string dfirstName, string dlastName, DateTime newAppointmentTime) { ClinicalDatabaseDataContext dc = new ClinicalDatabaseDataContext(); Appointment ap = new Appointment(); if (this.GetPatientInfo(pfirstName, plastName) == null || this.GetDoctorInfo(dfirstName, dlastName) == null) { return(false); } else { try { string insuranceNo = this.GetPatientInfo(pfirstName, plastName).insuranceNo; string registrationNo = this.GetDoctorInfo(dfirstName, dlastName).registrationNo; var existingApp = (from app in dc.Appointments where app.insuranceNo == insuranceNo && app.registrationNo == registrationNo select app).First(); existingApp.datetime = newAppointmentTime; dc.SubmitChanges(); } catch (Exception e) { Console.WriteLine(e.Message); throw e; } return(true); } }
public bool DoctorRegistration(Doctor d) { ClinicalDatabaseDataContext dc = new ClinicalDatabaseDataContext(); try { dc.Doctors.InsertOnSubmit(d); dc.SubmitChanges(); } catch (Exception e) { Console.WriteLine(e.Message); throw e; } return(true); }
public bool PatientRegistration(Patient p) { ClinicalDatabaseDataContext dc = new ClinicalDatabaseDataContext(); try { dc.Patients.InsertOnSubmit(p); dc.SubmitChanges(); } catch (Exception e) { Console.WriteLine(e.Message); throw e; } return(true); }