예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public TaskEntityModel Update(TaskEntityModel model)
        {
            Context.Configuration.AutoDetectChangesEnabled = true;

            var task = GetTask(model.TaskId);

            task.AssigneeId    = model.AssigneeId;
            task.Name          = model.Name;
            task.Description   = model.Description;
            task.Comments      = model.Comments;
            task.Deadline      = model.Deadline;
            task.InProgress    = model.InProgress;
            task.IsTesting     = model.IsTesting;
            task.IsCompleted   = model.IsCompleted;
            task.IsBacklog     = model.IsBacklog;
            task.CompletedDate = model.CompletedDate;

            task.ModifiedDate = DateTime.Now;

            Context.Entry(task).State = EntityState.Modified;
            // todo - set up needed agent
            Context.SaveChanges("System");

            SetProjectActivity(task.ProjectId);

            return(task);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public TaskEntityModel Create(TaskEntityModel model)
        {
            Context.Tasks.Add(model);
            // todo - set up needed agent
            Context.SaveChanges("System");

            SetProjectActivity(model.ProjectId);
            return(model);
        }