예제 #1
0
        public HttpResponseMessage ViewCurrentTableOrder(HttpRequestMessage req, RP_ViewCurrentTableOrder rpViewCurrentTableOrder)
        {
            if (rpViewCurrentTableOrder != null)
            {
                RM_ViewCurrentTableOrder rmViewCurrentTableOrder = new RM_ViewCurrentTableOrder();
                List<RPR_ViewCurrentTableOrder> rprViewCurrentTableOrder = rmViewCurrentTableOrder.ViewCurrentTableOrder(rpViewCurrentTableOrder);

                if (rmViewCurrentTableOrder._IsSuccess)
                    return req.CreateResponse<List<RPR_ViewCurrentTableOrder>>(HttpStatusCode.Created, rprViewCurrentTableOrder);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
예제 #2
0
        public List<RPR_ViewCurrentTableOrder> ViewCurrentTableOrder(RP_ViewCurrentTableOrder rpViewCurrentTableOrder)
        {
            this.SpName = "DigitalMenu_ViewCurrentTableOrder"; //Sp Name
                _IsSuccess = true;
                try
                {
                    SqlParameter[] param = new SqlParameter[4];
                    param[0] = new SqlParameter("@key", rpViewCurrentTableOrder.key);
                    param[1] = new SqlParameter("@WaitorId", rpViewCurrentTableOrder.WaiterId);
                    param[2] = new SqlParameter("@RestId", int.Parse(rpViewCurrentTableOrder.RestId));
                    param[3] = new SqlParameter("@TableNumber",rpViewCurrentTableOrder.TableNumber);

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