public IHttpActionResult CreateOutReqDetail(OutstandingReqDetailModel outreqdetail) { string error = ""; OutstandingReqDetailModel ordm = OutstandingReqDetailRepo.CreateOutReqDetail(outreqdetail, out error); if (error != "" || ordm == null) { return(Content(HttpStatusCode.BadRequest, error)); } return(Ok(ordm)); }
public IHttpActionResult UpdateOutReqDetail(OutstandingReqDetailModel outreqdetail) { string error = ""; OutstandingReqDetailModel ordm = OutstandingReqDetailRepo.UpdateOutReqDetail(outreqdetail, out error); if (error != "" || ordm == null) { if (error == ConError.Status.NOTFOUND) { return(Content(HttpStatusCode.NotFound, "Outstanding Not Found")); } return(Content(HttpStatusCode.BadRequest, error)); } return(Ok(ordm)); }
public IHttpActionResult GetOutstandingItemList() { // declare and initialize error variable to accept the error from Repo string error = ""; // get the list from Repo and convert it into outstanding item list List <OutstandingItemModel> items = OutstandingReqDetailRepo.GetAllPendingOutstandingItems(out error); // if the erorr is not blank or the outstanding list is null if (error != "" || items == null) { // if the error is 404 if (error == ConError.Status.NOTFOUND) { return(Content(HttpStatusCode.NotFound, "Outstanding list Not Found")); } // if the error is other one return(Content(HttpStatusCode.BadRequest, error)); } // if there is no error return(Ok(items)); }
public IHttpActionResult GetAllOutReqDetails() { // declare and initialize error variable to accept the error from Repo string error = ""; // get the list from outstandingreqdetailRepo and will insert the error if there is one List <OutstandingReqDetailModel> ordms = OutstandingReqDetailRepo.GetAllOutReqDetails(out error); // if the erorr is not blank or the outstanding detail list is null if (error != "" || ordms == null) { // if the error is 404 if (error == ConError.Status.NOTFOUND) { return(Content(HttpStatusCode.NotFound, "Outstanding detail list Not Found")); } // if the error is other one return(Content(HttpStatusCode.BadRequest, error)); } // if there is no error return(Ok(ordms)); }