Example #1
0
        public void SaveUserInfo(UserInfo userInfo)
        {
            using (IUserRegistrationUow userRegInfoUow = new UserRegistrationUow())
            {
                BaseConverter<UserInfo, ApplicationUser> viewModelToAppUserModelConv= new BaseConverter<UserInfo, ApplicationUser>();
                var appUserDetails = viewModelToAppUserModelConv.SourceModelToTargetModel(userInfo, new ApplicationUser());
                appUserDetails.LoginId = "test";
                appUserDetails.LoginKey = "1";
                appUserDetails.IsSysGenerated = "Y";
                appUserDetails.RoleId = 1;
                appUserDetails.Email = "*****@*****.**";
                appUserDetails.StatusId = 1;
                appUserDetails.UserTypeId = 1;
                userRegInfoUow.AppUser.Add(appUserDetails);

                BaseConverter<UserInfo, MemberAccount> viewModelToMemAccModelConv = new BaseConverter<UserInfo, MemberAccount>();
                var memAccDetails = viewModelToMemAccModelConv.SourceModelToTargetModel(userInfo, new MemberAccount());
                memAccDetails.CreatedBy = 1;
                memAccDetails.CreatedTime = DateTime.Now;
                memAccDetails.Email = "*****@*****.**";
                userRegInfoUow.MemAccount.Add(memAccDetails);

                userRegInfoUow.Commit();
            }
        }
Example #2
0
        public List<UserInfo> FindUserList(int pageIndex, int pageCount)
        {
            if (pageIndex < 0 || pageCount <= 0)
                throw new ArgumentException(Messages.UserListTypeWarning);

            List<UserInfo> userInfoDetails = new List<UserInfo>();
            using (IUserRegistrationUow userRegInfoUow = new UserRegistrationUow())
            {
                userInfoDetails = userRegInfoUow.UserInfo.UserInfoList<DateTime>(pageIndex, pageCount, o => o.CreatedDateTime, false);
            }
            return userInfoDetails;
        }