protected void LoadNewValues(MySimpleAppointment newItem, MySimpleAppointment postedItem) { newItem.Label = postedItem.Label; newItem.EndDate = postedItem.EndDate; newItem.MyRecurrenceInfo = postedItem.MyRecurrenceInfo; newItem.ResourceID = postedItem.ResourceID; newItem.StartDate = postedItem.StartDate; newItem.Status = postedItem.Status; newItem.Title = postedItem.Title; newItem.Type = postedItem.Type; newItem.Description = postedItem.Description; }
public int Create(MySimpleAppointment postedItem) { int newID = 0; foreach (MySimpleAppointment item in AppointmentsData) { if (newID < item.ID) { newID = item.ID; } } newID = newID + 1; AppointmentsData[AppointmentsData.Count - 1].ID = newID; return(newID); }
public void Delete(MySimpleAppointment deletedItem) { var item = AppointmentsData.First(i => i.ID == deletedItem.ID); AppointmentsData.Remove(item); }
public void Update(MySimpleAppointment postedItem) { var editedItem = AppointmentsData.First(i => i.ID == postedItem.ID); LoadNewValues(editedItem, postedItem); }