示例#1
0
        public HttpResponseMessage GetAllTasks([FromBody] GetTaskViewModel task)
        {
            try
            {
                var resp = ToDoList_DB.getInstance().singleton.As <Task_DB>().pr_task_list(
                    iVch_cd_task: task.cd_task,
                    iVch_fecha: task.createdOnDate,
                    iVch_status_task: task.status_task,
                    iVch_title_task: task.title_task,
                    iVch_cd_user: task.cd_user,
                    pageIndex: task.pageIndex,
                    pageTotal: task.pageTotal);

                var vTest = new
                {
                    data = resp
                };

                return(Request.CreateResponse(HttpStatusCode.OK, vTest));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.ToString()));
            }
        }
示例#2
0
        public HttpResponseMessage SaveUser([FromBody] GetUserViewModel user)
        {
            try
            {
                ToDoList_DB.getInstance().singleton.As <User_DB>().pr_user_save(iVch_cd_user: user.cd_user,
                                                                                iVch_nm_user: user.cd_user);

                var vTest = new
                {
                    data = "Successfull"
                };

                return(Request.CreateResponse(HttpStatusCode.OK, vTest));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.ToString()));
            }
        }
示例#3
0
        public HttpResponseMessage GetAllUsers([FromBody] GetUserViewModel user)
        {
            try
            {
                var resp = ToDoList_DB.getInstance().singleton.As <User_DB>().pr_user_list(iVch_cd_user: user.cd_user,
                                                                                           iVch_nm_user: user.cd_user,
                                                                                           pageIndex: user.pageIndex,
                                                                                           pageTotal: user.pageTotal);

                var vTest = new
                {
                    data = resp
                };

                return(Request.CreateResponse(HttpStatusCode.OK, vTest));
            }
            catch (Exception ex) {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.ToString()));
            }
        }
示例#4
0
        public HttpResponseMessage ChangeStatusTask([FromBody] GetTaskViewModel task)
        {
            try
            {
                ToDoList_DB.getInstance().singleton.As <Task_DB>().pr_task_changeStatus(
                    iVch_cd_task: task.cd_task,

                    iVch_status_task: task.status_task

                    );

                var vTest = new
                {
                    data = "Success"
                };

                return(Request.CreateResponse(HttpStatusCode.OK, vTest));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.ToString()));
            }
        }
示例#5
0
 public void TestMethod1()
 {
     var conex = ToDoList_DB.getInstance().singleton;
 }