Ejemplo n.º 1
0
        public HttpResponseMessage DeleteTask(JObject deleteTaskParams)
        {
            dynamic json = deleteTaskParams;
            using (var repo = new BoardRepository())
            {
                repo.DeleteTask((int)json.taskId);
            }

            var response = Request.CreateResponse();
            response.StatusCode = HttpStatusCode.OK;

            return response;
        }
Ejemplo n.º 2
0
        public HttpResponseMessage AddComment(JObject addCommentParams)
        {
            dynamic json = addCommentParams;
            using (var repo = new BoardRepository())
            {
                repo.AddComment((int)json.taskId, (string)json.comment, User.Identity.GetUserId(), ((string)json.commentId == "") ? (int?)null : (int?)json.commentId);
            }

            var response = Request.CreateResponse();
            response.StatusCode = HttpStatusCode.OK;

            return response;
        }
Ejemplo n.º 3
0
        public HttpResponseMessage EditTask(JObject editTaskParams)
        {
            dynamic json = editTaskParams;
            using (var repo = new BoardRepository())
            {
                if (json.taskId == "")
                    repo.AddTask((string)json.taskName, (string)json.taskAssignee, (string)json.taskDueDate, (string)json.taskDescription);
                else
                    repo.EditTask((int)json.taskId, (string)json.taskName, (string)json.taskAssignee, (string)json.taskDueDate, (string)json.taskDescription);
            }

            var response = Request.CreateResponse();
                response.StatusCode = HttpStatusCode.OK;

                return response;
        }
Ejemplo n.º 4
0
        public HttpResponseMessage GetProjectUsers()
        {
            using (var repo = new BoardRepository())
            {
                var response = Request.CreateResponse();

                response.Content = new StringContent(JsonConvert.SerializeObject(repo.GetProjectUsers()));
                response.StatusCode = HttpStatusCode.OK;

                return response;
            }
        }
Ejemplo n.º 5
0
        public HttpResponseMessage Get(int projectId)
        {
            //Set Default Project
            System.Web.HttpContext.Current.Cache["ActiveProject"] = projectId;

            using (var repo = new BoardRepository())
            {
                var response = Request.CreateResponse();

                response.Content = new StringContent(JsonConvert.SerializeObject(repo.GetColumns()));
                response.StatusCode = HttpStatusCode.OK;

                return response;
            }
        }