public HttpResponseMessage InsertPosItemsList([FromBody] List <clsposItems> request) { HttpResponseMessage response = new HttpResponseMessage(); try { pos_itemsService objComService; if (request != null && request.Count > 0) { LoggerFactory.LoggerInstance.LogDebug("Request Started for : " + request[0].PosID); objComService = new pos_itemsService(); var objResponse = objComService.DeletePosItemsByPosId(request[0]); } for (int i = 0; i < request.Count; i++) { objComService = new pos_itemsService(); var objResponse = objComService.InsertPosItems(request[i]); if (objResponse != null && objResponse.ToString() != "") { response = Request.CreateResponse(HttpStatusCode.OK, objResponse); LoggerFactory.LoggerInstance.LogDebug("Request End for : " + request[i].PosItemID); } else { response = Request.CreateErrorResponse(HttpStatusCode.NotFound, "No detail found for Price : " + request[i].PosID + "."); } } } catch (Exception ex) { LoggerFactory.LoggerInstance.LogException(ex); response = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Error occured while getting Pos ITEM Id " + request[0].PosID + "."); } return(response); }
public HttpResponseMessage InsertPosItems([FromBody] clsposItems request) { LoggerFactory.LoggerInstance.LogDebug("Request Started for : " + request.PosItemID + "POS ID :" + request.PosID); HttpResponseMessage response = new HttpResponseMessage(); try { pos_itemsService objComService = new pos_itemsService(); var objResponse = objComService.InsertPosItems(request); if (objResponse != null && objResponse.ToString() != "") { response = Request.CreateResponse(HttpStatusCode.OK, objResponse); LoggerFactory.LoggerInstance.LogDebug("Request End for : " + request.PosItemID + " POS ID:" + request.PosID); } else { response = Request.CreateErrorResponse(HttpStatusCode.NotFound, "No detail found for Pos Item ID : " + request.PosID + "."); } } catch (Exception ex) { LoggerFactory.LoggerInstance.LogException(ex); response = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Error occured while getting Pos ITEM Id " + request.PosID + "."); } return(response); }