public static Appointment Add(Appointment model) { Initialise(); var check = TestDatabase.Get(model.AppointmentId); if (check != null) { throw new Exception("Error inserting record: Appointment.AppointmentId is auto incremented."); } model.AppointmentId = db.Count + 1; model.SystemStamp = DateTime.Now; db.Add(model); return(model); }
public List <Appointment> GetAppointmentsByMonth(int month) { return(TestDatabase.GetAppointments().Where(a => a.StartDate.Month == month || a.EndDate.Month == month).ToList()); }
public bool DeleteAppointment(int Id) { return(TestDatabase.DeleteAppointment(Id)); }
public Appointment UpdateAppointment(Appointment model) { return(TestDatabase.Update(model)); }
public Appointment GetAppointment(int Id) { return(TestDatabase.GetAppointments().Where(a => a.AppointmentId == Id).FirstOrDefault()); }
public int CreateAppointment(Appointment model) { var app = TestDatabase.Add(model); return(app.AppointmentId); }