예제 #1
0
        public HttpResponseMessage ViewTableOrder(HttpRequestMessage req, RP_ViewTableOrder rpViewTableOrder)
        {
            if (rpViewTableOrder != null)
            {
                RM_ViewTableOrder rmViewTableOrder = new RM_ViewTableOrder();
                List<RPR_ViewTableOrder> rprViewTableOrder = rmViewTableOrder.ViewTableOrder(rpViewTableOrder);

                if (rmViewTableOrder._IsSuccess)
                    return req.CreateResponse<List<RPR_ViewTableOrder>>(HttpStatusCode.Created, rprViewTableOrder);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
예제 #2
0
 public List<RPR_ViewTableOrder> ViewTableOrder(RP_ViewTableOrder rpViewTableOrder)
 {
     this.SpName = "DigitalMenu_ViewTableOrder"; //Sp Name
     _IsSuccess = true;
     try
     {
         SqlParameter[] param = new SqlParameter[5];
         param[0] = new SqlParameter("@key", rpViewTableOrder.key);
         param[1] = new SqlParameter("@PosId", int.Parse(rpViewTableOrder.PosId));
         param[2] = new SqlParameter("@RestId", int.Parse(rpViewTableOrder.RestId));
         param[3] = new SqlParameter("@TableNo", rpViewTableOrder.TableNo);
         param[4] = new SqlParameter("@WaitorId", rpViewTableOrder.WaitorId);
         ds = db.GetDataSet(this.SpName, param);
         if (ds != null && ds.Tables.Count > 0)
         {
             rprViewTableOrder = SerializeData.SerializeMultiValue<RPR_ViewTableOrder>(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         _IsSuccess = false;
         Logger.WriteLog(LogLevelL4N.ERROR, " View Table Order | Exception : " + ex.Message);
     }
     return rprViewTableOrder;
 }