/// <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);
        }
        public void SaveUserRegistrationRequest()
        {
            //Unified Data Store
            tblUserRegistrationRequestDto objDto = new tblUserRegistrationRequestDto();

            objDto.UserEmail = Cryptography.Encrypt("*****@*****.**");
            objDto.CountryOfRegistration = 101;
            objDto.RegistrationDate = DateTime.Now;
            objDto.RegistrationIP = "192.168.1.101";
            objDto.UserStatus = 0;
            objDto.NewsLetter = true;
            objDto.LoginPassword = Cryptography.Encrypt("*****@*****.**");

            RegistrationProvider objUserProfileDataProvider = new RegistrationProvider();
            int returnVal = objUserProfileDataProvider.SaveUserRegistrationRequest(objDto);

            Assert.AreEqual(1, returnVal, "It should return 1");
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Saves registration request
 /// </summary>
 /// <param name="userRegistrationRequestDto"></param>
 /// <returns></returns>
 public int SaveUserRegistrationRequest(tblUserRegistrationRequestDto userRegistrationRequestDto)
 {
     Mapper.CreateMap<tblUserRegistrationRequestDto, tblUserRegistrationRequest>();
     int result = 0;
     try
     {
         using (var userRegistrationRequestContext = new FPUserProfileEntities())
         {
             var userRegistrationRequest = new tblUserRegistrationRequest();
             Mapper.Map(userRegistrationRequestDto, userRegistrationRequest);
             userRegistrationRequestContext.tblUserRegistrationRequests.Add(userRegistrationRequest);
             result = userRegistrationRequestContext.SaveChanges();
         }
     }
     catch
     {
         return -1;
     }
     return result;
 }