コード例 #1
0
 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;
 }
コード例 #2
0
    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);
    }
コード例 #3
0
    public void Delete(MySimpleAppointment deletedItem)
    {
        var item = AppointmentsData.First(i => i.ID == deletedItem.ID);

        AppointmentsData.Remove(item);
    }
コード例 #4
0
    public void Update(MySimpleAppointment postedItem)
    {
        var editedItem = AppointmentsData.First(i => i.ID == postedItem.ID);

        LoadNewValues(editedItem, postedItem);
    }