public static void DeleteCustomAppointment(CustomAppointment deletedCustomAppointment) { List <CustomAppointment> CustomAppointments = GetCustomAppointmentsList(); CustomAppointment currentCustomAppointment = CustomAppointments.FirstOrDefault(c => c.Id.Equals(deletedCustomAppointment.Id)); if (currentCustomAppointment != null) { CustomAppointments.Remove(currentCustomAppointment); } }
public static object InsertCustomAppointment(CustomAppointment newCustomAppointment) { List <CustomAppointment> CustomAppointments = GetCustomAppointmentsList(); int lastCustomAppointmentID = CustomAppointments.Count == 0 ? 0 : CustomAppointments.OrderBy(c => c.Id).Last().Id; newCustomAppointment.Id = lastCustomAppointmentID + 1; CustomAppointments.Add(newCustomAppointment); return(newCustomAppointment.Id); }
public static void UpdateCustomAppointment(CustomAppointment updatedCustomAppointment) { List <CustomAppointment> CustomAppointments = GetCustomAppointmentsList(); CustomAppointment currentCustomAppointment = CustomAppointments.FirstOrDefault(c => c.Id.Equals(updatedCustomAppointment.Id)); currentCustomAppointment.AllDay = updatedCustomAppointment.AllDay; currentCustomAppointment.Description = updatedCustomAppointment.Description; currentCustomAppointment.EndTime = updatedCustomAppointment.EndTime; currentCustomAppointment.EventType = updatedCustomAppointment.EventType; currentCustomAppointment.Label = updatedCustomAppointment.Label; currentCustomAppointment.Location = updatedCustomAppointment.Location; currentCustomAppointment.RecurrenceInfo = updatedCustomAppointment.RecurrenceInfo; currentCustomAppointment.ReminderInfo = updatedCustomAppointment.ReminderInfo; currentCustomAppointment.ResourceId = updatedCustomAppointment.ResourceId; currentCustomAppointment.StartTime = updatedCustomAppointment.StartTime; currentCustomAppointment.Status = updatedCustomAppointment.Status; currentCustomAppointment.Subject = updatedCustomAppointment.Subject; currentCustomAppointment.UserIDs = updatedCustomAppointment.UserIDs; currentCustomAppointment.HostNotifications = updatedCustomAppointment.HostNotifications; }