Ejemplo n.º 1
0
        public ActionResult Index(int projectId)
        {
            try
            {
                if (User.Identity.IsAuthenticated)
                {
                    ITaskLogic logic = container.Resolve <ITaskLogic>();
                    var        model = logic.GetAllTasksForGivenProjectAndCurrentUser(projectId, User.Identity.Name);

                    var viewModel = new TasksViewModel(model.ToList());

                    return(Json(viewModel, JsonRequestBehavior.AllowGet));
                }
                return(Json(new JsonDataHandler(httpCode: HttpCodeEnum.Forbidden).getWarning(), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new JsonDataHandler(ex).getError(), JsonRequestBehavior.AllowGet));
            }
        }