public void SaveUserLoginCredentials()
        {
            UserLoginCredentialBO objUserLoginCredentialBO = new UserLoginCredentialBO();

            //Id
            objUserLoginCredentialBO.UserId = 101;
            objUserLoginCredentialBO.LoginPassword = Cryptography.Encrypt("Paresh@1234567");
            objUserLoginCredentialBO.LastPasswordChanged = DateTime.Now;
            objUserLoginCredentialBO.LastFailedLogin = DateTime.Now;
            objUserLoginCredentialBO.FailedLoginCount = 2;
            objUserLoginCredentialBO.IsLocked = false;
            objUserLoginCredentialBO.UserType = 1;
            objUserLoginCredentialBO.Key = Cryptography.Encrypt("Paresh@1234567");
            objUserLoginCredentialBO.Salt = Cryptography.Encrypt("Paresh@1234567");
            objUserLoginCredentialBO.CreatedBy = "Paresh Rao";
            objUserLoginCredentialBO.CreatedOn = DateTime.Now;
            objUserLoginCredentialBO.ModifiedBy = "Paresh Rao";
            objUserLoginCredentialBO.ModifiedOn = DateTime.Now;
            objUserLoginCredentialBO.IPAddressOfLastAction = "192.168.168.1";

            UserCredentialProviderDAL objUserCredentialDataProvider = new UserCredentialProviderDAL();
            int returnVal = objUserCredentialDataProvider.SaveUserLoginCredentials(objUserLoginCredentialBO);

            Assert.AreEqual(1, returnVal, "It should return 1");
        }
Esempio n. 2
0
        /// <summary>
        /// Saves user login credentials
        /// </summary>
        /// <param name="userLoginCredentialBO"></param>
        /// <returns></returns>
        public int SaveUserLoginCredentials(UserLoginCredentialBO userLoginCredentialBO)
        {
            int result = 0;
            if (ValidateUserLoginCredentials(userLoginCredentialBO))
            {

                UserCredentialProviderDAL objRegistrationProvider = new UserCredentialProviderDAL();
                result = objRegistrationProvider.SaveUserLoginCredentials(userLoginCredentialBO);
            }

            return result;
        }
        public int SaveUserLoginCredentials(UserLoginCredentialBusinessObject userLoginCredentialBO)
        {
            int result = 0;
            if (ValidateUserLoginCredentials(userLoginCredentialBO))
            {
                Mapper.CreateMap<UserLoginCredentialBusinessObject, tblUserLoginCredentialsDto>();
                var userLoginCredentialsDto = new tblUserLoginCredentialsDto();
                Mapper.Map(userLoginCredentialBO, userLoginCredentialsDto);

                UserCredentialProviderDAL objRegistrationProvider = new UserCredentialProviderDAL();
                result = objRegistrationProvider.SaveUserLoginCredentials(userLoginCredentialsDto);
            }

            return result;
        }
Esempio n. 4
0
        /// <summary>
        /// Saves user login security questions
        /// </summary>
        /// <param name="userLoginQuetionBO"></param>
        /// <returns></returns>
        public int SaveUserLoginQuestions(List<UserLoginQuetionBO> userLoginQuetionBO)
        {
            int result = 0;
            bool isValid = true;

            foreach (UserLoginQuetionBO objLoginQuestions in userLoginQuetionBO)
            {
                isValid = ValidateUserLoginQuestions(objLoginQuestions);
                if (!isValid) break;
            }
            if (isValid)
            {
                UserCredentialProviderDAL objRegistrationProvider = new UserCredentialProviderDAL();
                result = objRegistrationProvider.SaveUserLoginQuestions(userLoginQuetionBO);
            }
            return result;
        }
        public int SaveUserLoginQuestions(IEnumerable<UserLoginQuetionBusinessObject> userLoginQuetionBO)
        {
            int result = 0;
            bool isValid = true;

            foreach (UserLoginQuetionBusinessObject objLoginQuestions in userLoginQuetionBO)
            {
                isValid = ValidateUserLoginQuestions(objLoginQuestions);
                if (!isValid) break;
            }
            if (isValid)
            {
                Mapper.CreateMap<UserLoginQuetionBusinessObject, tblUserLoginQuestionsDto>();
                var userLoginQuestionsDto = new List<tblUserLoginQuestionsDto>();
                Mapper.Map(userLoginQuetionBO, userLoginQuestionsDto);

                UserCredentialProviderDAL objRegistrationProvider = new UserCredentialProviderDAL();
                result = objRegistrationProvider.SaveUserLoginQuestions(userLoginQuestionsDto);
            }
            return result;
        }
        public void SaveUserLoginQuestions()
        {
            List<UserLoginQuetionBO> userLoginQuestionsBO = new List<UserLoginQuetionBO>();

            for (int i = 0; i < 5; i++)
            {
                UserLoginQuetionBO objQuestionsBO = new UserLoginQuetionBO();
                objQuestionsBO.UserId = 201;
                objQuestionsBO.SecretQuestion = Cryptography.Encrypt("What is your Name " + i.ToString());
                objQuestionsBO.Answer = Cryptography.Encrypt("My Name is " + i.ToString());
                objQuestionsBO.CreatedBy = "CreatedBy Paresh " + i.ToString();
                objQuestionsBO.CreatedOn = DateTime.Now;
                objQuestionsBO.ModifiedBy = "ModifiedBy Paresh " + i.ToString();
                objQuestionsBO.ModifiedOn = DateTime.Now;
                objQuestionsBO.IPAddressOfLastAction = "192.168.15.24";
                userLoginQuestionsBO.Add(objQuestionsBO);
            }

            UserCredentialProviderDAL objUserCredentialDataProvider = new UserCredentialProviderDAL();
            int returnVal = objUserCredentialDataProvider.SaveUserLoginQuestions(userLoginQuestionsBO);

            Assert.AreEqual(5, returnVal, "It should return 1");
        }