示例#1
0
        /// <summary>
        /// Sign up customer by form information
        /// </summary>
        /// <param name="name"></param>
        /// <param name="email"></param>
        /// <param name="password"></param>
        public void SignUpCustomer(string name, string email, string password)
        {
            if (repo.GetCustomerByEmail(email) != null)
            {
                Log.Warning("Existing user attempted new sign up.");
                throw new Exception("Customer already exists!");
            }
            Customer newCustomer = new Customer(name, email, password);

            AddCustomer(newCustomer);
            SaveChanges();
        }
示例#2
0
        public async Task <bool> CustomerExist(RequestCustomerUpdateModel customer)
        {
            var email = customer.Email;
            var c     = await _customerRepo.GetCustomerByEmail(email);

            if (c == null)
            {
                return(false);
            }
            return(true);
        }
示例#3
0
        public Customer GetCustomerByEmail(string email)
        {
            Customer customer = custRepo.GetCustomerByEmail(email);

            return(customer);
        }