Beispiel #1
0
 private void CreateFooter(ShopOnlineTTSDbContext context)
 {
     if (context.Footers.Count(x => x.ID == CommonConstants.DefaultFooterId) == 0)
     {
         string content = "";
     }
 }
Beispiel #2
0
        private void CreateUser(ShopOnlineTTSDbContext context)
        {
            //var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ShopOnlineTTSDbContext()));

            //var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(new ShopOnlineTTSDbContext()));

            //var user = new ApplicationUser()
            //{
            //    UserName = "******",
            //    Email = "*****@*****.**",
            //    EmailConfirmed = true,
            //    BirthDay = DateTime.Now,
            //    FullName = "Technology Education"

            //};

            //manager.Create(user, "123654$");

            //if (!roleManager.Roles.Any())
            //{
            //    roleManager.Create(new IdentityRole { Name = "Admin" });
            //    roleManager.Create(new IdentityRole { Name = "User" });
            //}

            //var adminUser = manager.FindByEmail("*****@*****.**");

            //manager.AddToRoles(adminUser.Id, new string[] { "Admin", "User" });
        }
Beispiel #3
0
        private void CreateSlide(ShopOnlineTTSDbContext context)
        {
            if (context.Slides.Count() == 0)
            {
                List <Slide> listSlide = new List <Slide>()
                {
                    new Slide()
                    {
                        Name         = "Slide 1",
                        DisplayOrder = 1,
                        Status       = true,
                        Url          = "#",
                        Image        = "/Assets/client/images/bag.jpg",
                        Content      = @"	<h2>FLAT 50% 0FF</h2>
                                <label>FOR ALL PURCHASE <b>VALUE</b></label>
                                <p>Lorem ipsum dolor sit amet, consectetur 
                                adipisicing elit, sed do eiusmod tempor incididunt ut labore et </ p >
                                <span class=""on-get"">GET NOW</span>"
                    },

                    new Slide()
                    {
                        Name         = "Slide 2",
                        DisplayOrder = 2,
                        Status       = true,
                        Url          = "#",
                        Image        = "/Assets/client/images/bag1.jpg",
                        Content      = @"<h2>FLAT 50% 0FF</h2>
                                <label>FOR ALL PURCHASE <b>VALUE</b></label>

                                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et </ p >

                                <span class=""on-get"">GET NOW</span>"
                    }
                };
                context.Slides.AddRange(listSlide);
                context.SaveChanges();
            }
        }
 public ApplicationUserStore(ShopOnlineTTSDbContext context)
     : base(context)
 {
 }
Beispiel #5
0
 public ShopOnlineTTSDbContext Init()
 {
     return(dbContext ?? (dbContext = new ShopOnlineTTSDbContext()));
 }