Esempio n. 1
0
        public HttpResponseMessage WaiterChekoutCus(HttpRequestMessage req, RP_WaiterChekoutCus rpWaiterChekoutCus)
        {
            if (rpWaiterChekoutCus != null)
            {
                RM_WaiterChekoutCus rmWaiterChekoutCus = new RM_WaiterChekoutCus();
                List<RPR_WaiterChekoutCus> rprWaiterChekoutCus = rmWaiterChekoutCus.WaiterChekoutCus(rpWaiterChekoutCus);

                if (rmWaiterChekoutCus._IsSuccess)
                    return req.CreateResponse<List<RPR_WaiterChekoutCus>>(HttpStatusCode.Created, rprWaiterChekoutCus);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Esempio n. 2
0
        public List<RPR_WaiterChekoutCus> WaiterChekoutCus(RP_WaiterChekoutCus rpWaiterChekoutCus)
        {
            this.SpName = "DigitalMenu_WaiterChekoutCus"; //Sp Name
                  _IsSuccess = true;
                  try
                  {
                      SqlParameter[] param = new SqlParameter[5];
                      param[0] = new SqlParameter("@key", rpWaiterChekoutCus.key);
                      param[1] = new SqlParameter("@WaitorId", rpWaiterChekoutCus.WaiterId);
                      param[2] = new SqlParameter("@RestId", int.Parse(rpWaiterChekoutCus.RestId));
                      param[3] = new SqlParameter("@PosId", int.Parse(rpWaiterChekoutCus.PosId));
                      //param[4] = new SqlParameter("@CusId", rpWaiterChekoutCus.cusId);
                      param[4] = new SqlParameter("@TableNo", rpWaiterChekoutCus.TableNo);

                      ds = db.GetDataSet(this.SpName, param);
                      if (ds != null && ds.Tables.Count > 0)
                      {
                          rprWaiterChekoutCus = SerializeData.SerializeMultiValue<RPR_WaiterChekoutCus>(ds.Tables[0]);
                      }
                  }
                  catch (Exception ex)
                  {
                      _IsSuccess = false;
                      Logger.WriteLog(LogLevelL4N.ERROR, " waiter chk out customer    | Exception : " + ex.Message);
                  }
                  return rprWaiterChekoutCus;
        }