public IHttpActionResult CreateNewCustomer(CustomerRegistraionInfo customerInfo)
        {
            Customer customer = new Customer()
            {
                FIRST_NAME         = customerInfo.FIRST_NAME,
                LAST_NAME          = customerInfo.LAST_NAME,
                USER_NAME          = customerInfo.USER_NAME,
                PASSWORD           = customerInfo.PASSWORD,
                ADDRESS            = customerInfo.ADDRESS,
                PHONE_NO           = customerInfo.PHONE_NO,
                CREDIT_CARD_NUMBER = customerInfo.CREDIT_CARD_NUMBER
            };

            try
            {
                CustomerMvcController cus = new CustomerMvcController();
                anonymousUser.CreateNewCustomer(customer);
                cus.Email(customerInfo);
                return(Ok("Account created successfully! Please verify your email"));
            }
            catch (Exception e)
            {
                if (customer == null)
                {
                    return(BadRequest("Bad info was given! "));
                }
                return(BadRequest(e.Message));
            }
        }
        public IHttpActionResult CreateNewCustomer([FromBody] Customer customer)
        {
            IHttpActionResult result = controllersCenter.ExecuteSafe(() =>
            {
                customer.Customer_Number = facade.CreateNewCustomer(customer);
                return(Ok("You Have Successfully Signed Up !! You Only Have To Verify Your Email."));
            });

            return(result); // for debug - break point here
        }
示例#3
0
        public IActionResult CreateCustomer([FromBody] Customer customer)
        {
            IActionResult result = SafeExecute(() =>
            {
                AnonymousUserFacade.CreateNewCustomer(customer);
                return(Ok($"{customer.UserName} created succesfully."));
            });

            return(result);
        }