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())); } }
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())); } }
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())); } }
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())); } }
public void TestMethod1() { var conex = ToDoList_DB.getInstance().singleton; }