public HttpResponseMessage UpdateCart(HttpRequestMessage req, RP_DeleteCart rpDeleteCart) { if (rpDeleteCart != null) { RM_DeleteCart rmDeleteCart = new RM_DeleteCart(); List<RPR_DeleteCart> rprDeleteCart = rmDeleteCart.DeleteCart(rpDeleteCart); if (rmDeleteCart._IsSuccess) return req.CreateResponse<List<RPR_DeleteCart>>(HttpStatusCode.Created, rprDeleteCart); return req.CreateErrorResponse(HttpStatusCode.InternalServerError, "ServerError"); } return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request"); }
public List<RPR_DeleteCart> DeleteCart(RP_DeleteCart rpDeleteCart) { this.SpName = "DigitalMenu_DeleteCart"; //Sp Name _IsSuccess = true; try { SqlParameter[] param = new SqlParameter[6]; param[0] = new SqlParameter("@WaitorId", rpDeleteCart.WaitorId.Trim()); param[1] = new SqlParameter("@key", rpDeleteCart.key); param[2] = new SqlParameter("@RestId", int.Parse(rpDeleteCart.RestId)); param[3] = new SqlParameter("@CusId", int.Parse(rpDeleteCart.CusId)); param[4] = new SqlParameter("@TableId", rpDeleteCart.TableId); param[5] = new SqlParameter("@ItemId", rpDeleteCart.ItemId); ds = db.GetDataSet(this.SpName, param); if (ds != null && ds.Tables.Count > 0) { rprDeleteCart = SerializeData.SerializeMultiValue<RPR_DeleteCart>(ds.Tables[0]); } } catch (Exception ex) { _IsSuccess = false; Logger.WriteLog(LogLevelL4N.ERROR, " Update Cart | Exception : " + ex.Message); } return rprDeleteCart; }