public bool CheckDoctorDetailByID(string ID) { DoctorDetail t = null; using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3()) { var conflist = conf.DoctorDetails; try { t = (from n in conflist where n.DoctorName == ID select n).First(); } catch (Exception e) { Console.WriteLine(e); // throw; } if (t == null) { return(false); } else { return(true); } } }
public List <AppointmentDetail> GetAllAppointments() { List <AppointmentDetail> conflist = new List <AppointmentDetail>(); using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3()) { conflist = conf.AppointmentDetails.ToList(); return(conflist); } }
public bool createAppointment(AppointmentDetail a) { using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3()) { a.AppointmentID = Guid.NewGuid().ToString(); conf.AppointmentDetails.Add(a); conf.SaveChanges(); } return(true); }
public IEnumerable <DoctorDetail> GetAllDcotors() { List <DoctorDetail> conflist = new List <DoctorDetail>(); using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3()) { conflist = conf.DoctorDetails.ToList(); return(conflist); } }
public DoctorDetail getDoctorDetailByID(string ID) { DoctorDetail t = new DoctorDetail(); using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3()) { var conflist = conf.DoctorDetails; t = (from n in conflist where n.DoctorName == ID select n).First(); return(t); } }
public bool addPatient(PatientViewModel d) { using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3()) { PatientDetail p = new PatientDetail(); p.PatientID = Guid.NewGuid().ToString(); p.PatientName = d.PatientName; p.HealthConditions = d.HealthConditions; p.Age = d.Age; p.Gender = d.Gender.ToString(); conf.PatientDetails.Add(p); conf.SaveChanges(); return(true); } }
public bool addDoctor(DoctorViewModel d) { using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3()) { DoctorDetail e = new DoctorDetail(); e.DoctorID = Guid.NewGuid().ToString(); e.DoctorName = d.DoctorName; e.Specaility = d.Specaility.ToString(); if (d.isAvailable == true) { e.IsAvailable = "yes"; } else { e.IsAvailable = "no"; } conf.DoctorDetails.Add(e); conf.SaveChanges(); return(true); } }