Ejemplo n.º 1
0
        public HttpResponseMessage DeleteOrderItem(HttpRequestMessage req, RP_DeleteOrderItem rpDeleteOrderItem)
        {
            if (rpDeleteOrderItem != null)
            {
                RM_DeleteOrderItem rmDeleteOrderItem = new RM_DeleteOrderItem();
                List<RPR_DeleteOrderItem> rprDeleteOrderItem = rmDeleteOrderItem.DeleteOrderItem(rpDeleteOrderItem);

                if (rmDeleteOrderItem._IsSuccess)
                    return req.CreateResponse<List<RPR_DeleteOrderItem>>(HttpStatusCode.Created, rprDeleteOrderItem);

                return req.CreateErrorResponse(HttpStatusCode.InternalServerError, "ServerError");
            }

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Ejemplo n.º 2
0
        public List<RPR_DeleteOrderItem> DeleteOrderItem(RP_DeleteOrderItem rpDeleteOrderItem)
        {
            this.SpName = "DigitalMenu_DeleteOrderItem"; //Sp Name
                _IsSuccess = true;
                try
                {
                    SqlParameter[] param = new SqlParameter[6];
                    param[0] = new SqlParameter("@key", rpDeleteOrderItem.key);
                    param[1] = new SqlParameter("@WaiterId", rpDeleteOrderItem.WaitorId);
                    param[2] = new SqlParameter("@RestId", int.Parse(rpDeleteOrderItem.RestId));
                    param[3] = new SqlParameter("@TableNo", rpDeleteOrderItem.TableNo);
                    param[4] = new SqlParameter("@ItemId", rpDeleteOrderItem.ItemID);
                    param[5] = new SqlParameter("@cartId", int.Parse(rpDeleteOrderItem.cartId));

                    ds = db.GetDataSet(this.SpName, param);
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        rprDeleteOrderItem = SerializeData.SerializeMultiValue<RPR_DeleteOrderItem>(ds.Tables[0]);
                    }
                }
                catch (Exception ex)
                {
                    _IsSuccess = false;
                    Logger.WriteLog(LogLevelL4N.ERROR, " View  Current Table Order | Exception : " + ex.Message);
                }
                return rprDeleteOrderItem;
        }