Ejemplo n.º 1
0
        public HttpResponseMessage UpdateDeliveryQunatity(HttpRequestMessage req, RP_UpdateDeliveryQunatity rpUpdateDeliveryQunatity)
        {
            if (rpUpdateDeliveryQunatity != null)
            {
                RM_UpdateDeliveryQunatity rmUpdateDeliveryQunatity = new RM_UpdateDeliveryQunatity();
                List<RPR_UpdateDeliveryQunatity> rprUpdateDeliveryQunatity = rmUpdateDeliveryQunatity.UpdateDeliveryQunatity(rpUpdateDeliveryQunatity);

                if (rmUpdateDeliveryQunatity._IsSuccess)
                    return req.CreateResponse<List<RPR_UpdateDeliveryQunatity>>(HttpStatusCode.Created, rprUpdateDeliveryQunatity);

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

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

                    ds = db.GetDataSet(this.SpName, param);
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        rprUpdateDeliveryQunatity = SerializeData.SerializeMultiValue<RPR_UpdateDeliveryQunatity>(ds.Tables[0]);
                    }
                }
                catch (Exception ex)
                {
                    _IsSuccess = false;
                    Logger.WriteLog(LogLevelL4N.ERROR, " update Delievry Qunatity | Exception : " + ex.Message);
                }
                return rprUpdateDeliveryQunatity;
        }