public static IEnumerable <Visit> SearchVisit(Patient patient, Physiotherapist physio, DateTime?selDate, ApplicationDbContext dbcontext) { //Visit w = dbcontext.Visits.Local.Where(ww => ww.IdVisit == 36) as Visit; //DateTime dt = DateTime.Now; //MessageBox.Show(selDate.Value.ToShortDateString() + " " + dt.ToShortDateString()); IEnumerable <Visit> results = dbcontext.Visits.Local.Where(v => (patient != null ? v.Referral.Patient.Equals(patient) : true) && (physio != null ? v.Physiotherapist.Equals(physio) : true) && (selDate != null ? v.VisitDate.Equals(selDate) : true)); return(results); }
public Visit(Physiotherapist physio, Referral referral, DateTime date, string time, bool visitCompleted = false, bool visitSettled = false) { this.Physiotherapist = physio; this.Referral = referral; this.VisitDate = date; this.VisitTime = time; this.DateSaved = DateTime.Now; this.VisitCompleted = visitCompleted; this.VisitSettled = visitSettled; }
public static void DeletePhysiotherapist(Physiotherapist physio, ApplicationDbContext dbcontext) { try { dbcontext.Physiotherapists.Remove(physio); dbcontext.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static void AddPhysiotherapist(string name, string surname, string adress, string phone, string email, int npwz, ApplicationDbContext dbcontext) { Physiotherapist physio = new Physiotherapist(name, surname, adress, phone, email, npwz); try { dbcontext.Physiotherapists.Add(physio); dbcontext.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static void AddVisit(Physiotherapist physio, Referral referral, DateTime date, string time, ApplicationDbContext dbcontext) { Visit vis = new Visit(physio, referral, date, time); try { dbcontext.Visits.Add(vis); dbcontext.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }