Ejemplo n.º 1
0
        public HttpResponseMessage CustomerSignUp(HttpRequestMessage req, RP_CustomerSignUp rpCustomerSignUp)
        {
            if (rpCustomerSignUp != null)
            {
                RM_CustomerSignUp rmCustomerSignUp = new RM_CustomerSignUp();
                List<RPR_SignUp> rprSignUp = rmCustomerSignUp.CustomerSignUp(rpCustomerSignUp);

                if (rmCustomerSignUp._IsSuccess)
                    return req.CreateResponse<List<RPR_SignUp>>(HttpStatusCode.Created, rprSignUp);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Ejemplo n.º 2
0
 public List<RPR_SignUp> CustomerSignUp(RP_CustomerSignUp rpCustomerSignUp)
 {
     this.SpName = "DigitalMenu_CustomerSignUp"; //Sp Name
     _IsSuccess = true;
     try
     {
         SqlParameter[] param = new SqlParameter[6];
         param[0] = new SqlParameter("@Name", rpCustomerSignUp.Name);
         param[1] = new SqlParameter("@Mobile", rpCustomerSignUp.Mobile);
         param[2] = new SqlParameter("@Email", string.IsNullOrEmpty(rpCustomerSignUp.Email) ? Convert.DBNull : rpCustomerSignUp.Email);
         param[3] = new SqlParameter("@Password", rpCustomerSignUp.Password);
         param[4] = new SqlParameter("@RestId", string.IsNullOrEmpty(rpCustomerSignUp.RestId) ? Convert.DBNull : int.Parse(rpCustomerSignUp.RestId));
         param[5] = new SqlParameter("@DeviceMac", string.IsNullOrEmpty(rpCustomerSignUp.DeviceMac) ? Convert.DBNull : rpCustomerSignUp.DeviceMac);
         ds = db.GetDataSet(this.SpName, param);
         if (ds != null && ds.Tables.Count > 0)
         {
             rprSignUp = SerializeData.SerializeMultiValue<RPR_SignUp>(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         _IsSuccess = false;
         Logger.WriteLog(LogLevelL4N.ERROR, " Customer SignUp | Exception : " + ex.Message);
     }
     return rprSignUp;
 }