P1_TrevorGraham/MvcStoreApplication/BusinessLogic/BusinessLogic.cs
/// <summary>
/// creates a customer in the db from the given customerViewModel
/// </summary>
/// <param name="customerViewModel"></param>
/// <returns></returns>
creates a customer in the db from the given customerViewModel
creates a customer in the db from the given customerViewModel
public bool CreateNewCustomer(CustomerViewModel customerViewModel)
        {
            if (UsernameExists(customerViewModel.Username))
            {
                return false;
            }
            Customer customer = _mapper.ConvertCustomerViewModelToCustomer(customerViewModel);
            if (_repository.AttemptAddCustomerToDb(customer))
            {
                if (AttemptSignIn(customerViewModel.Username, customerViewModel.Password))
                {
                    return true;
                }
            }
            return false;
        }
public bool CreateNewCustomer ( CustomerViewModel customerViewModel ) { if ( UsernameExists ( customerViewModel . Username ) ) { return false ; } Customer customer = _mapper . ConvertCustomerViewModelToCustomer ( customerViewModel ) ; if ( _repository . AttemptAddCustomerToDb ( customer ) ) { if ( AttemptSignIn ( customerViewModel . Username , customerViewModel . Password ) ) { return true ; } } return false ; }
creates a customer in the db from the given customerViewModel
creates a customer in the db from the given customerViewModel
None
customerViewModel
CustomerViewModel
None