Exemple #1
0
        public tbl_Customer SaveCustomer(string email, string firstName, string surname, string telephone, string title, string password, int domainID, int customerID, bool registered, bool detailsFor3rdParties, string adminNote)
        {
            if (registered && customerID == 0 && String.IsNullOrEmpty(password))
            {
                return(null);
            }

            if (String.IsNullOrEmpty(email))
            {
                return(null);
            }

            var customer = CustomerRepository.SaveCustomer(email, firstName, surname, telephone, title, domainID, customerID, registered, detailsFor3rdParties, adminNote);

            if (customer == null)
            {
                return(null);
            }

            if (!String.IsNullOrEmpty(password))
            {
                CustomerRepository.SavePassword(customer.CustomerID, Sha512.GetSHA512Hash(password));
            }

            return(customer);
        }
Exemple #2
0
        public tbl_AdminUsers SaveUser(string email, string userName, string password, int groupID, int userID)
        {
            if (userID == 0 && String.IsNullOrEmpty(password))
            {
                return(null);
            }

            password = String.IsNullOrEmpty(password) ? String.Empty : Sha512.GetSHA512Hash(password);
            return(AdminUserRepository.SaveUser(email, userName, password, groupID, userID));
        }
Exemple #3
0
 public tbl_AdminUsers GetUserByEmailAndPassword(string email, string password)
 {
     return(AdminUserRepository.GetByEmailAndPassword(email, Sha512.GetSHA512Hash(password)));
 }
Exemple #4
0
 public tbl_Customer GetCustomerByEmailAndPassword(string email, string password, int domainID)
 {
     return(CustomerRepository.GetByEmailAndPassword(email, Sha512.GetSHA512Hash(password), domainID));
 }