/// <summary> /// Method to save user registraton /// </summary> /// <param name="userRegistrationRequest"></param> /// <returns></returns> public int SaveUserRegistrationRequest(UserRegistrationRequestsViewModel userRegistrationRequest) { Mapper.CreateMap<UserRegistrationRequestsViewModel, UserRegistrationRequestBO>(); var userRegistrationRequestBusinessObject = new UserRegistrationRequestBO(); Mapper.Map(userRegistrationRequest, userRegistrationRequestBusinessObject); return _registrationBusinessLogic.SaveUserRegistrationRequest(userRegistrationRequestBusinessObject); }
/// <summary> /// Saves user registration request /// </summary> /// <param name="userRegistrationRequestBO"></param> /// <returns></returns> public int SaveUserRegistrationRequest(UserRegistrationRequestBO userRegistrationRequestBO) { tblUserRegistrationRequestDto tblUserRegRequestDto = new tblUserRegistrationRequestDto(); Mapper.CreateMap<UserRegistrationRequestBO, tblUserRegistrationRequestDto>(); Mapper.Map(userRegistrationRequestBO, tblUserRegRequestDto); RegistrationProvider objUserProfileDataProvider = new RegistrationProvider(); return objUserProfileDataProvider.SaveUserRegistrationRequest(tblUserRegRequestDto); }
/// <summary> /// Saves user registration requests /// </summary> /// <param name="userRegistrationRequestBO"></param> /// <returns></returns> public int SaveUserRegistrationRequest(UserRegistrationRequestBO userRegistrationRequestBO) { int result = 0; if (ValidateUserRegistrationRequest(userRegistrationRequestBO)) { RegistrationProviderDAL objRegistrationProvider = new RegistrationProviderDAL(); result = objRegistrationProvider.SaveUserRegistrationRequest(userRegistrationRequestBO); } return result; }
public void SaveUserRegistrationRequest() { UserRegistrationRequestBO objUserRegistrationRequestBO = new UserRegistrationRequestBO(); objUserRegistrationRequestBO.UserEmail = Cryptography.Encrypt("*****@*****.**"); objUserRegistrationRequestBO.CountryOfRegistration = 101; objUserRegistrationRequestBO.RegistrationDate = DateTime.Now; objUserRegistrationRequestBO.RegistrationIP = "192.168.1.101"; objUserRegistrationRequestBO.UserStatus = 0; objUserRegistrationRequestBO.NewsLetter = true; objUserRegistrationRequestBO.LoginPassword = Cryptography.Encrypt("*****@*****.**"); RegistrationBLL objRegistrationBL = new RegistrationBLL(); int returnVal = objRegistrationBL.SaveUserRegistrationRequest(objUserRegistrationRequestBO); Assert.AreEqual(1, returnVal, "It should return 1"); }
/// <summary> /// Validates registration request data /// </summary> /// <param name="userRegistrationRequestBO"></param> /// <returns></returns> private bool ValidateUserRegistrationRequest(UserRegistrationRequestBO userRegistrationRequestBO) { bool isValid = true; try { if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(userRegistrationRequestBO.UserEmail); //checking for null or empty if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(userRegistrationRequestBO.RegistrationDate);//checking for null or empty if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(userRegistrationRequestBO.UserStatus);//checking for null or empty if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(userRegistrationRequestBO.RegistrationIP);//checking for null or empty if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(userRegistrationRequestBO.CountryOfRegistration);//checking for null or empty } catch { isValid = false; } return isValid = true; }