Beispiel #1
0
        public HttpResponseMessage ViewAllTableOrder(HttpRequestMessage req, RP_ViewAllTableOrder rpViewAllTableOrder)
        {
            if (rpViewAllTableOrder != null)
            {
                RM_ViewAllTableOrder rmViewAllTableOrder = new RM_ViewAllTableOrder();
                List<RPR_ViewAllTableOrder> rprViewAllTableOrder = rmViewAllTableOrder.ViewAllTableOrder(rpViewAllTableOrder);

                if (rmViewAllTableOrder._IsSuccess)
                    return req.CreateResponse<List<RPR_ViewAllTableOrder>>(HttpStatusCode.Created, rprViewAllTableOrder);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Beispiel #2
0
        public List<RPR_ViewAllTableOrder> ViewAllTableOrder(RP_ViewAllTableOrder rpViewAllTableOrder)
        {
            this.SpName = "DigitalMenu_ViewAllTableOrder"; //Sp Name
                _IsSuccess = true;
                try
                {
                    SqlParameter[] param = new SqlParameter[3];
                    param[0] = new SqlParameter("@key", rpViewAllTableOrder.key);
                    param[1] = new SqlParameter("@WaiterId", rpViewAllTableOrder.WaiterId);
                    param[2] = new SqlParameter("@RestId", int.Parse(rpViewAllTableOrder.RestId));

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