Beispiel #1
0
        public HttpResponseMessage CustomerPayMode(HttpRequestMessage req,RP_CustomerPayMode rpCustomerPayMode)
        {
            if (rpCustomerPayMode != null)
            {
                RM_CustomerPayMode rmCustomerPayMode = new RM_CustomerPayMode();
                List<RPR_CustomerPayMode> rprCustomerPayMode = rmCustomerPayMode.PayMode(rpCustomerPayMode);

                if (rmCustomerPayMode._IsSuccess)
                    return req.CreateResponse<List<RPR_CustomerPayMode>>(HttpStatusCode.Created, rprCustomerPayMode);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Beispiel #2
0
 public List<RPR_CustomerPayMode> PayMode(RP_CustomerPayMode rpCustomerPayMode)
 {
     this.SpName = "DigitalMenu_CustomerPayMode"; //Sp Name
     _IsSuccess = true;
     try
     {
         SqlParameter[] param = new SqlParameter[7];
         param[0] = new SqlParameter("@WaitorId", rpCustomerPayMode.WaitorId.Trim());
         param[1] = new SqlParameter("@key", rpCustomerPayMode.key);
         param[2] = new SqlParameter("@RestId", int.Parse(rpCustomerPayMode.RestId));
         param[3] = new SqlParameter("@CusId", int.Parse(rpCustomerPayMode.CusId));
         param[4] = new SqlParameter("@TableId", rpCustomerPayMode.TableId);
         param[5] = new SqlParameter("@ItemId", rpCustomerPayMode.ItemId);
         param[6] = new SqlParameter("@PayMode", rpCustomerPayMode.PayMode);
         ds = db.GetDataSet(this.SpName, param);
         if (ds != null && ds.Tables.Count > 0)
         {
             rprCustomerPayMode = SerializeData.SerializeMultiValue<RPR_CustomerPayMode>(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         _IsSuccess = false;
         Logger.WriteLog(LogLevelL4N.ERROR, " Customer Pay Mode | Exception : " + ex.Message);
     }
     return rprCustomerPayMode;
 }