Beispiel #1
0
        public bool UpdateActionPlan(UpdateActionPlanVM actionPlan)
        {
            try
            {
                var item = _dbContext.ActionPlans.Find(actionPlan.ID);
                if (actionPlan.Title.IsNullOrEmpty())
                {
                    item.Title = actionPlan.Title;
                }
                if (actionPlan.Description.IsNullOrEmpty())
                {
                    item.Description = actionPlan.Description;
                }
                if (actionPlan.Tag.IsNullOrEmpty())
                {
                    item.Tag = actionPlan.Tag;
                }
                if (actionPlan.DeadLine.IsNullOrEmpty())
                {
                    item.Deadline = Convert.ToDateTime(actionPlan.DeadLine);
                }

                _dbContext.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
 public async Task <JsonResult> UpdateActionPlan(UpdateActionPlanVM actionPlan)
 {
     return(Json(await new ActionPlanDAO().UpdateActionPlan(actionPlan), JsonRequestBehavior.AllowGet));
 }
Beispiel #3
0
 public JsonResult UpdateActionPlan(UpdateActionPlanVM actionPlan)
 {
     return(Json(new ActionPlanDAO().UpdateActionPlan(actionPlan), JsonRequestBehavior.AllowGet));
 }