public void AddToDoListObject(ToDoListObject obj)
        {
            obj.ID = _toDoListObjectList.Count == 0 ? 1 : _toDoListObjectList.Max(x => x.ID) + 1;
            int counter = 0;

            foreach (var item in obj.ToDoListItems)
            {
                counter++;
                item.ID = counter;
                item.ToDoListObjectId = obj.ID;
            }
            _toDoListObjectList.Add(obj);
        }
        public void UpdateToDoListObject(int ID, ToDoListObject targetObj)
        {
            var _toDoListObject = _toDoListObjectList.FirstOrDefault(x => x.ID == ID);

            if (_toDoListObject != null)
            {
                _toDoListObject.Description = targetObj.Description;
                foreach (var item in _toDoListObject.ToDoListItems)
                {
                    var targetItem = targetObj.ToDoListItems.FirstOrDefault(x => x.ID == item.ID);
                    item.Description = targetItem.Description;
                    item.Status      = targetItem.Status;
                }
            }
        }
Esempio n. 3
0
 public void UpdateToDoListObject(int ID, ToDoListObject targetObj)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
 public void AddToDoListObject(ToDoListObject obj)
 {
     throw new NotImplementedException();
 }