Example #1
0
        public CustomErrors Register(string FirstName, string LastName, string Email, string UserName, string PassWord)
        {
            CustomErrors retValue = new CustomErrors(false,"success");
            UserAccountDBAccess = new DBControl(UserName, PassWord);
            Tuple<int, CustomErrors> registrationStatus = UserAccountDBAccess.RegisterUser(FirstName, LastName, Email, UserName, PassWord);

            UserLog = new LogControl(UserName,PassWord);
            UserLog.Initialize();
            if (!registrationStatus.Item2.Status)
            {
                Username = UserName;
                Password = PassWord;
                retValue =UserLog.genereateNewLogFile(registrationStatus.Item1);

                if (retValue.Status && retValue.Code >= 20000000)//error 20000000 denotes log creation issue
                {
                    UserAccountDBAccess.deleteUser();
                }
            }

            return retValue;
        }