public async Task <Boolean> SaveAsync() { Boolean OK = true; foreach (WorksheetDTO worksheet in Worksheets) { if (worksheet.Closed) { if (await _persistence.SaveWorksheetAsync(worksheet)) { AppointmentList.Remove(worksheet.Appointment); } else { worksheet.Closed = false; worksheet.Appointment.HasClosedWorksheet = false; OK = false; } } } Worksheets.RemoveAll(w => w.Closed); return(OK); }
//Appointment Methods static public void GetAllAppointments(HairSpaContext context) { //Clear appointment list, then add appointment table records to the list. AppointmentList.ToList().ForEach(ap => AppointmentList.Remove(ap)); context.Appointments.ToList().ForEach(ap => AppointmentList.Add(ap)); }