Beispiel #1
0
        public void Update(ActTask task)
        {
            var taskDb = Get(task.Id);

            taskDb.Title       = task.Title;
            taskDb.Description = task.Description;
            taskDb.ParentId    = task.ParentId;
        }
Beispiel #2
0
 public void SaveActTask(ActTask task)
 {
     task.Validate();
     if (task.Id == 0)
     {
         task.Id = _rand.Next(0, 10000000);
         _repository.Insert(task);
     }
     else if (_repository.Get(task.Id) != null)
     {
         _repository.Update(task);
     }
     else
     {
         throw new Exception(string.Format("TaskId {0} not found", task.Id));
     }
 }
Beispiel #3
0
 public void Delete(ActTask task)
 {
     myDatabase.Remove(task);
 }
Beispiel #4
0
 public void Insert(ActTask task)
 {
     myDatabase.Add(task);
 }