private static string InsertUser(UserInfo user, bool isTest)
        {
            string errorMessage = string.Empty;

            IMembershipTools membershipTools = AppTools.InitMembershipTools(isTest);
            ISprocCalls      sprocCalls      = AppTools.InitSprocCalls(isTest);

            if (membershipTools.CreateUser(user.UserName, user.Email, user.Password) == false ||
                sprocCalls.UserInfoUpdate(user) == false)
            {
                errorMessage = "Error saving user information.";
            }

            return(errorMessage);
        }
Exemple #2
0
        public static void InsertUser(UserInfo user, out string errorMessage, bool isTest = false)
        {
            try
            {
                errorMessage = ValidateUser(user);

                if (string.IsNullOrEmpty(errorMessage))
                {
                    IMembershipTools membershipTools = AppTools.InitMembershipTools(isTest);
                    ISprocCalls      sprocCalls      = AppTools.InitSprocCalls(isTest);

                    if (membershipTools.CreateUser(user.UserName, user.Email) == false ||
                        sprocCalls.UserInfoUpdate(user) == false)
                    {
                        errorMessage = "Error saving user information.";
                    }
                }
            }
            catch (Exception ex)
            {
                DBCommands.RecordError(ex);
                errorMessage = ex.Message;
            }
        }