コード例 #1
0
 public ShowmuWebUserManager(ApplicationDbContext dbContext, IUserStore <TUser> store, IOptions <IdentityOptions> optionsAccessor, IPasswordHasher <TUser> passwordHasher, IEnumerable <IUserValidator <TUser> > userValidators, IEnumerable <IPasswordValidator <TUser> > passwordValidators, ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, IServiceProvider services, ILogger <UserManager <TUser> > logger) :
     base(store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger)
 {
     _dbContext          = dbContext;
     _userBaseRepository = new UserBaseRepository(_dbContext);
     _roleBaseRepository = new RoleBaseRepository(_dbContext);
 }
コード例 #2
0
        public IActionResult Index()
        {
            ApplicationUser   LoginUser = new UserBaseRepository(_dbContext).Find(s => s.UserName == User.Identity.Name.ToString());
            ComBaseRepository comNew    = new WebDataLibrary.Models.ComBaseRepository(_dbContext);


            Web_Com newCom = new Web_Com
            {
                ComName       = "京翔布鞋",
                CreateUser    = LoginUser,
                DbName        = "Shop",
                DbVer         = 1,
                DetailAddress = "四川成都",
                EditDate      = DateTime.Now,
                EditUser      = LoginUser,
                InDate        = DateTime.Now,
                Money         = 1.20M,
                Pid           = "123456x",
                Name          = "showmu",
                Tel           = "18108195338"
            };

            if (comNew.Exist(s => s.ComName == "京翔布鞋"))
            {
                ViewData["Message"] = " 京翔布鞋已存在,换过名字罢!";
            }
            else
            {
                comNew.Add(newCom, true);
                comNew.Save();
                if (comNew.Exist(s => s.ComName == "京翔布鞋"))
                {
                    ViewData["Message"] = " 京翔布鞋添加成功!";
                }
                else
                {
                    ViewData["Message"] = "测试添加失败.";
                }
            }

            return(View());
        }
コード例 #3
0
 public UserBaseBO(UserBaseRepository UserRepository)
 {
     _UserBaseRepository = UserRepository;
 }