Пример #1
0
        public ActionResult MenuView()
        {
            OnlineShoppingContext sb = new OnlineShoppingContext();
            var s = sb.GetMenu();

            return(View(s));
        }
Пример #2
0
 public UnitOfWork(OnlineShoppingContext context)
 {
     _context  = context;
     Customers = new AuthRepository(_context);
 }
Пример #3
0
 public ProductsController(OnlineShoppingContext context, IProductManager productBusinessLayer)
 {
     _context = context;
     _productBusinessLayer = productBusinessLayer;
 }
Пример #4
0
 public AuthController(OnlineShoppingContext context, IAuthBusiness authBusiness, IConfiguration config)
 {
     _context      = context;
     _authBusiness = authBusiness;
     _config       = config;
 }
Пример #5
0
 public VipRanksController(OnlineShoppingContext context)
 {
     _context = context;
 }
Пример #6
0
 public CategoriesController(OnlineShoppingContext context)
 {
     _context = context;
 }
Пример #7
0
 public FeedBacksController(OnlineShoppingContext context)
 {
     _context = context;
 }
 public AuthRepository(OnlineShoppingContext context)
 {
     this.context = context;
 }
 public PaymentsController(OnlineShoppingContext context, IPaymentManager paymentManager)
 {
     _context        = context;
     _paymentManager = paymentManager;
 }
Пример #10
0
        public static void Initialize(OnlineShoppingContext context)
        {
            context.Database.EnsureCreated();

            // Look for any Products or Categories.
            if (context.Products.Any() || context.Categories.Any())
            {
                return;   // DB has been seeded
            }

            string date = DateTime.Now.ToString("MM/dd/yyyy");

            //Add Categories
            var categories = new Category[]
            {
                new Category {
                    Name = "Men's Shoes", CreatedDate = DateTime.Parse(date), IsActive = true
                },
                new Category {
                    Name = "Women's Shoes", CreatedDate = DateTime.Parse(date), IsActive = true
                },
                new Category {
                    Name = "Accessories", CreatedDate = DateTime.Parse(date), IsActive = true
                },
                new Category {
                    Name = "Clothing", CreatedDate = DateTime.Parse(date), IsActive = true
                }
            };

            context.Categories.AddRange(categories);
            context.SaveChanges();

            //Add Images
            var images = new Image[]
            {
                new Image {
                    ImagePath = "../../assets/images/product-1.png"
                },
                new Image {
                    ImagePath = "../../assets/images/product-2.png"
                },
                new Image {
                    ImagePath = "../../assets/images/product-3.png"
                },
                new Image {
                    ImagePath = "../../assets/images/product-4.png"
                },
                new Image {
                    ImagePath = "../../assets/images/product-5.png"
                },
                new Image {
                    ImagePath = "../../assets/images/product-6.png"
                },
                new Image {
                    ImagePath = "../../assets/images/product-7.png"
                },
                new Image {
                    ImagePath = "../../assets/images/product-8.png"
                },
            };

            context.Images.AddRange(images);
            context.SaveChanges();

            //Add Products
            var desc = "A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.";

            desc += " ";
            desc += "everything that was left from its origin would be the word and and the Little Blind Text should turn around and return to its own, safe country. But nothing the copy said could convince her and so it didn’t take long until a few insidious Copy Writers ambushed her, made her drunk with Longe and Parole and dragged her into their agency, where they abused her for their.";

            var products = new Product[]
            {
                new Product {
                    Name = "NIKE FREE RN 2019 ID", Description = desc, Qty = 10, SellingPrice = 120, Discount = 0, UnitPrice = 120, CreatedDate = DateTime.Parse(date), CategoryId = 1, ImageId = 1, IsActive = true
                },
                new Product {
                    Name = "NIKE FREE RN 2019 ID", Description = desc, Qty = 10, SellingPrice = 80, Discount = 50, UnitPrice = 120, CreatedDate = DateTime.Parse(date), CategoryId = 2, ImageId = 2, IsActive = true
                },
                new Product {
                    Name = "NIKE FREE RN 2019 ID", Description = desc, Qty = 10, SellingPrice = 120, Discount = 0, UnitPrice = 120, CreatedDate = DateTime.Parse(date), CategoryId = 3, ImageId = 3, IsActive = true
                },
                new Product {
                    Name = "NIKE FREE RN 2019 ID", Description = desc, Qty = 10, SellingPrice = 120, Discount = 0, UnitPrice = 120, CreatedDate = DateTime.Parse(date), CategoryId = 4, ImageId = 4, IsActive = true
                },
                new Product {
                    Name = "NIKE FREE RN 2019 ID", Description = desc, Qty = 10, SellingPrice = 120, Discount = 0, UnitPrice = 120, CreatedDate = DateTime.Parse(date), CategoryId = 1, ImageId = 5, IsActive = true
                },
                new Product {
                    Name = "NIKE FREE RN 2019 ID", Description = desc, Qty = 10, SellingPrice = 80, Discount = 50, UnitPrice = 120, CreatedDate = DateTime.Parse(date), CategoryId = 2, ImageId = 6, IsActive = true
                },
                new Product {
                    Name = "NIKE FREE RN 2019 ID", Description = desc, Qty = 10, SellingPrice = 120, Discount = 0, UnitPrice = 120, CreatedDate = DateTime.Parse(date), CategoryId = 3, ImageId = 7, IsActive = true
                },
                new Product {
                    Name = "NIKE FREE RN 2019 ID", Description = desc, Qty = 10, SellingPrice = 120, Discount = 0, UnitPrice = 120, CreatedDate = DateTime.Parse(date), CategoryId = 4, ImageId = 8, IsActive = true
                },
            };

            context.Products.AddRange(products);

            context.SaveChanges();
        }
Пример #11
0
 public BrandsController(OnlineShoppingContext context)
 {
     _context = context;
 }
Пример #12
0
 public TypesController(OnlineShoppingContext context)
 {
     _context = context;
 }
Пример #13
0
 public DiscountsController(OnlineShoppingContext context)
 {
     _context = context;
 }
Пример #14
0
 public ProductService(OnlineShoppingContext _db)
 {
     db = _db;
 }
 /// <summary>Initializes a new instance of the <see cref="OrderPItemRepository" /> class.</summary>
 /// <param name="dataContext">The data context.</param>
 /// <param name="mapper">The mapper.</param>
 public OrderItemRepository(OnlineShoppingContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Пример #16
0
 public OrdersController(OnlineShoppingContext context)
 {
     _context = context;
 }
Пример #17
0
 public ProductRepository(OnlineShoppingContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Пример #18
0
 public RegisterController(OnlineShoppingContext context)
 {
     _context = context;
 }
 public LoginsController(OnlineShoppingContext context)
 {
     _context = context;
 }
Пример #20
0
 public ProductsController(OnlineShoppingContext context)
 {
     _context = context;
 }
Пример #21
0
 public CategoryRepository(OnlineShoppingContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Пример #22
0
 public UnitofWork(OnlineShoppingContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Пример #23
0
 public UserInforsController(OnlineShoppingContext context)
 {
     _context = context;
 }
Пример #24
0
 public CategoryService(OnlineShoppingContext _db, ProductService _ps)
 {
     db = _db;
     ps = _ps;
 }