Exemplo n.º 1
0
        public IActionResult About()
        {
            var s = HttpContext.Session.GetString("testsession");

            //事务操作
            using (var context = new TradeDbContext(_serviceProvider.GetRequiredService <DbContextOptions <TradeDbContext> >()))
            {
                Guid departmentId = Guid.NewGuid();
                //增加一个部门
                context.Departments.Add(
                    new Vic.Core.Domain.Entities.Department
                {
                    ID       = departmentId,
                    Code     = "BD",
                    Name     = "商务部",
                    ParentId = Guid.Empty
                }
                    );

                context.Roles.Add(new Vic.Core.Domain.Entities.Role()
                {
                    ID         = Guid.NewGuid(),
                    Code       = "Aduit",
                    CreateTime = DateTime.Now,
                    Name       = "认证员",
                    Remarks    = "认证员"
                });
                //增加一个超级管理员用户
                context.Users.Add(
                    new Vic.Core.Domain.Entities.User
                {
                    UserName     = "******",
                    Password     = "******",  //暂不进行加密
                    Name         = "管理员",
                    DepartmentId = departmentId
                }
                    );

                context.CustomerUser.Add(new Vic.Core.Domain.Entities.CustomerUser()
                {
                    Mobile = "13430932507",
                    AuthenticationVerify = 1,
                    VerifyResult         = 0,
                    NickName             = "VIC",
                    RealName             = "VIC LI",
                    Type      = 1,
                    Status    = 1,
                    PassWord  = "******",
                    TPassWord = "******",
                    CreatorID = Vic.Core.Utils.ConstDefine.SuperAdminID
                });

                context.SaveChanges();
            }
            ViewData["Message"] = "Your application description page.";

            return(View());
        }
Exemplo n.º 2
0
        public static void SeedHostDb(TradeDbContext context)
        {
            context.SuppressAutoSetTenantId = true;

            //Host seed
            new InitialHostDbBuilder(context).Create();

            //Default tenant seed (in host database).
            new DefaultTenantBuilder(context).Create();
            new TenantRoleAndUserBuilder(context, 1).Create();
        }
Exemplo n.º 3
0
 public InitialHostDbBuilder(TradeDbContext context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public UserMenuRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
Exemplo n.º 5
0
 public TradesController(TradeDbContext context)
 {
     _context = context;
 }
Exemplo n.º 6
0
 public CustomerUserRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
Exemplo n.º 7
0
 public DefaultLanguagesCreator(TradeDbContext context)
 {
     _context = context;
 }
Exemplo n.º 8
0
 public TenantRoleAndUserBuilder(TradeDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
Exemplo n.º 9
0
 public SysLogRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
Exemplo n.º 10
0
 public DepartmentRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
Exemplo n.º 11
0
 public TotalBrief(TradeDbContext ct, IMemoryCache mCache)
 {
     context     = ct;
     memoryCache = mCache;
 }
Exemplo n.º 12
0
 public ArticleTypeRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
Exemplo n.º 13
0
 public DefaultEditionCreator(TradeDbContext context)
 {
     _context = context;
 }
Exemplo n.º 14
0
 public TestDataBuilder(TradeDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
Exemplo n.º 15
0
 public WidgetService(TradeDbContext context)
 {
     _context = context;
     _redisDb = new RedisCache(10);
 }
Exemplo n.º 16
0
 public LanguageTypeRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
Exemplo n.º 17
0
 public BannerRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
 public TestOrganizationUnitsBuilder(TradeDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
Exemplo n.º 19
0
 public HomeController(TradeDbContext context)
 {
     _context = context;
 }
Exemplo n.º 20
0
 public TestSubscriptionPaymentBuilder(TradeDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
Exemplo n.º 21
0
 public ShortMsgConfigRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
Exemplo n.º 22
0
 public SystemRepository(TradeDbContext _context)
 {
     context = _context;
 }
 //private readonly ICapPublisher _publisher;
 public ValueMapsRepository(TradeDbContext ct)
 {
     context = ct;
 }
Exemplo n.º 24
0
 public PushServiceRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
Exemplo n.º 25
0
 public DefaultTenantBuilder(TradeDbContext context)
 {
     _context = context;
 }
Exemplo n.º 26
0
 public TagController(IWidgetService widgetService,
                      TradeDbContext context)
 {
     _widgetService = widgetService;
     _context       = context;
 }
Exemplo n.º 27
0
 public VerifyCodeRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
Exemplo n.º 28
0
 public DefaultSettingsCreator(TradeDbContext context)
 {
     _context = context;
 }
Exemplo n.º 29
0
 public MailTemplateRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }
Exemplo n.º 30
0
 public SiteSettingRepository(TradeDbContext dbcontext, ReadOnlyTradeDbContext dbReadContext) : base(dbcontext, dbReadContext)
 {
 }