public MessagingManager(ICommunicationDispatcher <IMessage> messageCommunicationDispatcher, IRecipientManager recipientManager, IMessageBuilder messageBuilder, IUserProfileManager userProfileManager)
 {
     this._messageCommunicationDispatcher = messageCommunicationDispatcher;
     this._recipientManager   = recipientManager;
     this._messageBuilder     = messageBuilder;
     this._userProfileManager = userProfileManager;
 }
Esempio n. 2
0
        public UserEventHubTests(DatabaseFixture fixture)
        {
            this.eventHubMoq = new Mock <IUserEventHub>();
            var userRepository = new Repository <UserProfile>(fixture.AppContext);

            this.userProfileManager = new UserProfileManager(userRepository, eventHubMoq.Object);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="UserProfileController"/> class.
 /// </summary>
 /// <param name="manager">the manager to use.</param>
 /// <param name="userManager">The user manager.</param>
 public UserProfileController(
     IUserProfileManager manager,
     UserManager <AppUser> userManager)
     : base(manager)
 {
     this.userManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
 }
Esempio n. 4
0
 public RepositoryManager(string connectionString)
 {
     _ctx               = new ConferenceContext(connectionString);
     UserManager        = new ApplicationUserManager(new UserStore <ApplicationUser>(_ctx));
     RoleMaanger        = new ApplicationRoleManager(new RoleStore <ApplicationRole>(_ctx));
     UserProfileManager = new UserProfileManager(_ctx);
 }
Esempio n. 5
0
 public IdentityContext(string connectionName)
 {
     db                 = new ApplicationContext(connectionName);
     userManager        = new ApplicationUserManager(new UserStore <ApplicationUser>(db));
     roleManager        = new ApplicationRoleManager(new RoleStore <ApplicationRole>(db));
     userProfileManager = new UserProfileManager(db);
     movieManager       = new MovieManager(db);
 }
Esempio n. 6
0
 public MainPage()
 {
     InitializeComponent();
     WebServices      = new WebService();
     ProfileManager   = new UserProfileManager();
     ProfileLink.Text = $"{StaticHolders.Instance.CurrentUser.Name} {StaticHolders.Instance.CurrentUser.LastName}";
     CurrentProfilePictureBox.ImageLocation = StaticHolders.Instance.CurrentUser.UserImage;
     CurrentProfilePictureBox.SizeMode      = PictureBoxSizeMode.StretchImage;
     UserFriends = StaticHolders.Instance.CurrentUser.userFriends;
 }
Esempio n. 7
0
 public IdentityUnitOfWork(string connectionString)
 {
     _db                  = new EF.AppContext(connectionString);
     _userManager         = new ApplicationUserManager(new UserStore <ApplicationUser>(_db));
     _roleManager         = new ApplicationRoleManager(new RoleStore <ApplicationRole>(_db));
     _postRepository      = new PostRepository(_db);
     _userProfileManager  = new UserProfileManager(_db);
     _groupRepository     = new GroupRepository(_db);
     _groupPostRepository = new GroupPostRepository(_db);
 }
Esempio n. 8
0
 public AccountBusinessService(IMapper mapper,
                               UserManager <ApplicationUserEntity> userManager,
                               RoleManager <IdentityRole> roleManager,
                               SignInManager <ApplicationUserEntity> signInManager,
                               IUserProfileManager userProfileManager)
 {
     _mapper             = mapper;
     _userManager        = userManager;
     _roleManager        = roleManager;
     _signInManager      = signInManager;
     _userProfileManager = userProfileManager;
 }
        public UserProfilePopUpViewModel(
            IUserProfileManager userProfileManager,
            INavigationService navigationService)
        {
            GoToUserProfileCommand = ReactiveCommand.CreateFromTask(userProfileManager.GetUser);

            Activator = new ViewModelActivator();

            this.WhenActivated(disposables =>
            {
                GoToUserProfileCommand.Select(user => typeof(UserProfileViewModel))
                .Subscribe(navigationService.Navigate)
                .DisposeWith(disposables);

                Disposable.Create(() => { }).DisposeWith(disposables);
            });
        }
Esempio n. 10
0
 NotificationManager()
 {
     profileManager = new UserProfileManager();
     webServices    = new WebService();
 }
Esempio n. 11
0
 public AccountController(IWebSecurity webSecurity, IUserProfileManager userProfileManager)
 {
     _webSecurity = webSecurity;
     _userProfileManager = userProfileManager;
 }
 public UserProfileController(IMapper mapper, IUserProfileManager manager)
 {
     _mapper  = mapper;
     _manager = manager;
 }
Esempio n. 13
0
 public UsersController(IUserProfileManager ProfileManager)
 {
     profileManager = ProfileManager;
 }
Esempio n. 14
0
        public bool Authencate(string userCode, AuthIdentityInfo authinfo)
        {
            if (authinfo.Score < 60)
            {
                Alert("认证匹配度太低,认证失败");
                return(false);
            }
            var fac = UserModuleFactory.GetUserModuleInstance();

            if (fac == null)
            {
                Alert((ResultType)541, "系统错误");
                return(false);
            }
            IUser user = fac.GetUserByCode(userCode);

            if (user == null)
            {
                Alert((ResultType)404, "用户账户未注册");
                return(false);
            }
            if (user.Auth_Status != Interface.Enums.Auth_Status.未认证 && user.Auth_Status != Interface.Enums.Auth_Status.认证失败)
            {
                Alert((ResultType)409, user.Auth_Status.ToString() + ",请不要重复上传");
                return(false);
            }
            try
            {
                IDCard idCard = new IDCard(authinfo.ID_NO);
                if (!idCard.IsValid)
                {
                    Alert((ResultType)409, "身份证号码有误");
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Alert("身份证号码验证失败,请检查您上传的身份证号码");
                Log.Info("身份证号码验证失败", ex);
                return(false);
            }
            IUserProfileManager userMgt = fac.GetProfileManager(user);

            if (userMgt == null)
            {
                Alert((ResultType)541, "系统错误");
                return(false);
            }
            BeginTransaction();
            Tnet_User_Documents daDocs = new Tnet_User_Documents();

            daDocs.ReferenceTransactionFrom(Transaction);
            bool isSubmit = daDocs.SelectByUid_DocType_DelFlag(user.UserId, DocsType.身份证);

            if (isSubmit && daDocs.Status != (int)ValidateStatus.审核未通过)
            {
                Rollback();
                Alert((ResultType)409, "您的认证信息已提交,请勿重复提交");
                return(false);
            }
            Tnet_Identity daIdentity = new Tnet_Identity();

            daIdentity.ReferenceTransactionFrom(Transaction);
            bool isExist = daIdentity.SelectByIdentity_No(authinfo.ID_NO);

            if (isExist)
            {
                Tnet_User_DocumentsCollection daDocsColl = new Tnet_User_DocumentsCollection();
                daDocsColl.ListByDocs_id(daIdentity.Id, DocsType.身份证);
                if (daDocsColl.Count > 0)
                {
                    foreach (Tnet_User_Documents item in daDocsColl)
                    {
                        if (item.User_Id != user.UserId)
                        {
                            Rollback();
                            Alert("该证件已被其他账号认证!");
                            return(false);
                        }
                    }
                }
            }
            if (!isExist || (isExist && daIdentity.Status != 1))//证件不存在,或证件存在但未通过认证
            {
                daIdentity.User_Name   = authinfo.RealName;
                daIdentity.Identity_No = authinfo.ID_NO;
                daIdentity.Status      = 0;
                daIdentity.Region_Id   = authinfo.Region_Id;
                daIdentity.Front_Photo = authinfo.Front_Photo;
                daIdentity.Back_Photo  = authinfo.Back_Photo;
                daIdentity.Scene_Photo = authinfo.Scene_Photo;
                daIdentity.Sex         = GetGenderFromIdNo(authinfo.ID_NO);
                daIdentity.Birthday    = GetBirthFromIdNO(authinfo.ID_NO);
                daIdentity.Address     = authinfo.Address;
                daIdentity.Begin_Time  = authinfo.Begin_Date;
                daIdentity.End_Time    = authinfo.EndDate;
                daIdentity.Issuing     = authinfo.Issuing;
                daIdentity.Nation      = authinfo.Nation;
                if (!isExist)
                {
                    if (!daIdentity.Insert())
                    {
                        Rollback();
                        Alert((ResultType)540, "认证信息录入失败");
                        return(false);
                    }
                }
                else
                {
                    if (!daIdentity.Update())
                    {
                        Rollback();
                        Alert((ResultType)541, "认证信息录入失败");
                        return(false);
                    }
                }
            }

            daDocs.User_Id        = user.UserId;
            daDocs.Documents_Type = (int)DocsType.身份证;
            daDocs.Documents_Id   = daIdentity.Id;
            daDocs.Status         = (int)ValidateStatus.审核中;
            if (isSubmit)
            {
                if (!daDocs.Update())
                {
                    Rollback();
                    Alert((ResultType)544, "认证信息录入失败");
                    return(false);
                }
            }
            else
            {
                if (!daDocs.Insert())
                {
                    Rollback();
                    Alert((ResultType)542, "认证信息录入失败");
                    return(false);
                }
            }
            user.Auth_Status = Interface.Enums.Auth_Status.认证中;
            if (!userMgt.Update())
            {
                Rollback();
                Alert("系统繁忙,请稍后重试");
                return(false);
            }
            Commit();
            Task.Factory.StartNew(() =>
            {
                if (authinfo.Score >= 80)//活体认证得分大于等于80分,自动审核通过
                {
                    AuthenticationProvider identity = new AuthenticationProvider();
                    bool res = identity.Validate(daDocs.Id, true, 0, "系统自动通过");
                    Log.Info($"自动审核,结果:{res},错误信息:{identity.PromptInfo.CustomMessage}");
                }
                else
                {
                    Log.Info("活体认证得分低于80分,转入人工审核");
                }
            });
            return(true);
        }
Esempio n. 15
0
 public NotificationManager(IRecipientManager recipientManager, ICommunicationDispatcher <string> notificationCommunicationDispatcher, IUserProfileManager userProfileManager)
 {
     this._recipientManager = recipientManager;
     this._notificationCommunicationDispatcher = notificationCommunicationDispatcher;
     this._userProfileManager = userProfileManager;
 }
Esempio n. 16
0
 public AccountController()
 {
     _webSecurity = new WebMatrixSecurity();
     _userProfileManager = new UserProfileManager();
 }
Esempio n. 17
0
 public UserProfileController(IUserProfileManager userProfileManager)
 {
     _userProfileManager = userProfileManager;
 }
 public ProfileController(IUserProfileManager userProfileManager)
 {
     _userProfileManager = userProfileManager;
 }