Example #1
0
 public ReceiptNoteRepository(EShopContext context) : base(context)
 {
 }
Example #2
0
 public CustomersController(EShopContext context)
 {
     _context = context;
 }
Example #3
0
 public CategoryRepository(EShopContext EShopContext) : base(EShopContext)
 {
 }
Example #4
0
 public SupplierRepository(EShopContext context) : base(context)
 {
 }
Example #5
0
        public static void EnsureSeedDataForProducts(this EShopContext context)
        {
            if (context.Products.Any())
            {
                return;
            }

            var products = new List <Product>
            {
                new Product
                {
                    ImageUri  = "http://icons.iconarchive.com/icons/mdgraphs/iphone-4g/512/iPhone-4G-shadow-icon.png",
                    Price     = 1399.99M,
                    Label     = "iPhone X - Apple",
                    Available = true
                },
                new Product
                {
                    ImageUri  = "http://icons.iconarchive.com/icons/dailyoverview/tv/256/television-06-icon.png",
                    Price     = 999.99M,
                    Label     = "Samsung Smart TV",
                    Available = true
                },
                new Product
                {
                    Price     = 399.99M,
                    ImageUri  = "http://icons.iconarchive.com/icons/dapino/summer-blue/512/Fan-icon.png",
                    Label     = "XXX Fan",
                    Available = true
                },
                new Product
                {
                    Price    = 1399.99M,
                    Label    = "Magic wand",
                    ImageUri =
                        "http://icons.iconarchive.com/icons/custom-icon-design/flatastic-6/512/Magic-wand-icon.png",
                    Available = false
                },
                new Product
                {
                    Price     = 14.99M,
                    Label     = "Funky Soccer Ball",
                    ImageUri  = "http://icons.iconarchive.com/icons/martin-berube/sport/256/Soccer-icon.png",
                    Available = true
                },
                new Product
                {
                    Price     = 4.99M,
                    Label     = "Teddy bear",
                    ImageUri  = "http://icons.iconarchive.com/icons/custom-icon-design/flatastic-10/512/Bear-icon.png",
                    Available = true
                },
                new Product
                {
                    Price     = 123.78M,
                    Label     = "Classic Watch",
                    ImageUri  = "http://icons.iconarchive.com/icons/r34n1m4ted/chanel/512/WATCH-icon.png",
                    Available = true
                },
                new Product
                {
                    Price    = 4.99M,
                    Label    = "Walking with dinosaurs DVD",
                    ImageUri =
                        "http://icons.iconarchive.com/icons/firstline1/movie-mega-pack-5/512/Walking-with-Dinosaurs-icon.png",
                    Available = true
                },
                new Product
                {
                    Price    = 12.99M,
                    Label    = "ADATA USB Stick 128 GB",
                    ImageUri =
                        "http://icons.iconarchive.com/icons/jonathan-rey/device/256/Kingston-DataTraveler-USB-Stick-icon.png",
                    Available = true
                },
                new Product
                {
                    Price     = 1.99M,
                    Label     = "ICONIX MICRO SD 16 GB",
                    ImageUri  = "http://icons.iconarchive.com/icons/dakirby309/simply-styled/128/Micro-SD-Card-icon.png",
                    Available = true
                }
            };

            context.Products.AddRange(products);
            context.SaveChanges();
        }
Example #6
0
        public static void Initialize(this EShopContext context)
        {
            //// first, clear the database.  This ensures we can always start
            //// fresh with each demo.  Not advised for production environments, obviously :-)
            //context.Cities.RemoveRange(context.Cities);

            //context.SaveChanges();
            context.Database.EnsureCreated();

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

            // init seed data
            var categories = new List <Category>()
            {
                new Category()
                {
                    CategoryId   = 1,
                    CategoryName = "Eletronics",
                    Description  = "Eletronics in general"
                },
                new Category()
                {
                    CategoryId   = 2,
                    CategoryName = "Home",
                    Description  = "Home in general"
                }
            };

            var products = new List <Product>()
            {
                new Product()
                {
                    ProductId   = 1,
                    ProductName = "Celular TOP 1",
                    Description = "great celaular",
                    ProductCode = "cel01",
                    Price       = 10000,
                    ReleaseDate = new DateTime(2020, 09, 22),
                    Category    = new Category
                    {
                        CategoryId   = 1,
                        CategoryName = "Eletronics",
                        Description  = "Eletronics in general"
                    }
                },
                new Product()
                {
                    ProductId   = 2,
                    ProductName = "TV 4K 1",
                    Description = "great TV",
                    ProductCode = "tv01",
                    Price       = 5000,
                    ReleaseDate = new DateTime(2020, 09, 22),
                    Category    = new Category
                    {
                        CategoryId   = 1,
                        CategoryName = "Eletronics",
                        Description  = "Eletronics in general"
                    }
                }
            };

            context.Products.AddRange(products);
            context.SaveChanges();
        }
Example #7
0
 public InputRepository(EShopContext context) : base(context)
 {
 }
 public PurshaseRepository(EShopContext dbContext)
 {
     _dbContext = dbContext;
 }
Example #9
0
 public UnitOfWork()
 {
     this.context = new EShopContext();
 }
 public ProductRepository(EShopContext dbContext)
 {
     _dbContext = dbContext;
 }
Example #11
0
 public ItemAssetService(EShopContext context)
 {
     _context = context;
 }
Example #12
0
 public PackRepository(EShopContext context) : base(context)
 {
 }
 public CategoryRepository(EShopContext context)
 {
     this._context = context;
 }
Example #14
0
 public PermissionRepository(EShopContext context) : base(context)
 {
 }
Example #15
0
 public UserRepository(EShopContext dbContext)
 {
     _dbContext = dbContext;
 }
Example #16
0
 public UnitOfWork(EShopContext context)
 {
     this.context = context;
 }
Example #17
0
 public HomeController(EShopContext context)
 {
     _context = context;
 }
Example #18
0
 public ItemsController(EShopContext context)
 {
     _context = context;
 }
 public ProductRepository(EShopContext context)
 {
     this._context = context;
 }
Example #20
0
 public CategoriesController(EShopContext context)
 {
     _context = context;
 }
Example #21
0
 public CountryRepository(EShopContext EShopContext) : base(EShopContext)
 {
 }
Example #22
0
 public InventoryRepository(EShopContext EShopContext) : base(EShopContext)
 {
 }
Example #23
0
        public static void EnsureSeedDataForOrders(this EShopContext context)
        {
            if (context.Orders.Any())
            {
                return;
            }

            var orders = new List <Order>
            {
                new Order
                {
                    CustomerId      = 1,
                    Customer        = null,
                    DeliveryAddress = "3 Forest Dale Way",
                    OrderDetails    = new List <OrderDetail>
                    {
                        new OrderDetail
                        {
                            ProductId = 1,
                            Quantity  = 2,
                        },
                        new OrderDetail
                        {
                            ProductId = 3,
                            Quantity  = 1
                        }
                    }
                },
                new Order
                {
                    CustomerId      = 1,
                    Customer        = null,
                    DeliveryAddress = "14 Center Court",
                    OrderDetails    = new List <OrderDetail>
                    {
                        new OrderDetail
                        {
                            ProductId = 1,
                            Quantity  = 2,
                        }
                    }
                },

                new Order
                {
                    CustomerId      = 5,
                    Customer        = null,
                    DeliveryAddress = "8 Northfield Terrace",
                    OrderDetails    = new List <OrderDetail>
                    {
                        new OrderDetail
                        {
                            ProductId = 1,
                            Quantity  = 3,
                        },
                        new OrderDetail
                        {
                            ProductId = 10,
                            Quantity  = 1
                        },
                        new OrderDetail
                        {
                            ProductId = 4,
                            Quantity  = 1
                        }
                    }
                },

                new Order
                {
                    CustomerId      = 6,
                    Customer        = null,
                    DeliveryAddress = "9 Buhler Alley",
                    OrderDetails    = new List <OrderDetail>
                    {
                        new OrderDetail
                        {
                            ProductId = 7,
                            Quantity  = 1,
                        },
                        new OrderDetail
                        {
                            ProductId = 3,
                            Quantity  = 1
                        },
                        new OrderDetail
                        {
                            ProductId = 5,
                            Quantity  = 1,
                        },
                        new OrderDetail
                        {
                            ProductId = 8,
                            Quantity  = 1
                        }
                    }
                },

                new Order
                {
                    CustomerId      = 4,
                    Customer        = null,
                    DeliveryAddress = "9151 Becker Circle",
                    OrderDetails    = new List <OrderDetail>
                    {
                        new OrderDetail
                        {
                            ProductId = 1,
                            Quantity  = 1,
                        },
                        new OrderDetail
                        {
                            ProductId = 4,
                            Quantity  = 1
                        }
                    }
                },

                new Order
                {
                    CustomerId      = 4,
                    Customer        = null,
                    DeliveryAddress = "90640 5th Alley",
                    OrderDetails    = new List <OrderDetail>
                    {
                        new OrderDetail
                        {
                            ProductId = 8,
                            Quantity  = 1,
                        },
                        new OrderDetail
                        {
                            ProductId = 6,
                            Quantity  = 1
                        }
                    }
                },

                new Order
                {
                    CustomerId      = 3,
                    Customer        = null,
                    DeliveryAddress = "10869 Arizona Street",
                    OrderDetails    = new List <OrderDetail>
                    {
                        new OrderDetail
                        {
                            ProductId = 1,
                            Quantity  = 1,
                        },
                        new OrderDetail
                        {
                            ProductId = 2,
                            Quantity  = 1,
                        },
                        new OrderDetail
                        {
                            ProductId = 9,
                            Quantity  = 1
                        }
                    }
                },
            };


            context.Orders.AddRange(orders);
            context.SaveChanges();
        }
Example #24
0
 public WareHouseRepository(EShopContext context) : base(context)
 {
 }
 public CatalogItemsController(EShopContext dbContext)
 {
     _dbContext = dbContext;
 }
Example #26
0
 public CarrierRepository(EShopContext context) : base(context)
 {
 }
Example #27
0
 public OrderRepository(EShopContext context)
 {
     this._context = context;
 }
Example #28
0
 public InventoryCheckpointRepository(EShopContext context) : base(context)
 {
 }
Example #29
0
 public LanguageRepository(EShopContext context) : base(context)
 {
 }
Example #30
0
 public OperationRepository(EShopContext context) : base(context)
 {
 }