示例#1
0
        public ActionResult Delete(int projectId, int id, Base.Model.Task task)
        {
            try
            {
                if (User.Identity.IsAuthenticated)
                {
                    ITaskLogic logic = container.Resolve <ITaskLogic>();
                    logic.HandleTaskDelete(projectId, id, User.Identity.Name);

                    return(Json(new JsonDataHandler(httpCode: HttpCodeEnum.OK, message: "Task successfully removed!"), JsonRequestBehavior.AllowGet));
                }
                return(Json(new JsonDataHandler(httpCode: HttpCodeEnum.Forbidden).getError(), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new JsonDataHandler(ex).getError(), JsonRequestBehavior.AllowGet));
            }
        }