Example #1
0
        public static void Initialize(EShopDBContext context)
        {
            context.Database.EnsureCreated();

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

            var matHangs = new MatHang[]
            {
                new MatHang {
                    MaMH = "mh06", Ten = "Alexander", MaLH = "lh01", MaDVT = "dvt01", NgaySanXuat = "18/07/1999", SoLuongNhap = 34, SoLuongBan = 23, GiaBan = 24, GiaMua = 10, NgayNhap = DateTime.Parse("2019-09-01")
                },
                new MatHang {
                    MaMH = "mh07", Ten = "Alonso", MaLH = "lh01", MaDVT = "dvt01", NgaySanXuat = "18/07/1999", SoLuongNhap = 34, SoLuongBan = 23, GiaBan = 24, GiaMua = 10, NgayNhap = DateTime.Parse("2017-09-01")
                },
                new MatHang {
                    MaMH = "mh08", Ten = "Anand", MaLH = "lh01", MaDVT = "dvt01", NgaySanXuat = "18/07/1999", SoLuongNhap = 34, SoLuongBan = 23, GiaBan = 24, GiaMua = 10, NgayNhap = DateTime.Parse("2018-09-01")
                },
                new MatHang {
                    MaMH = "mh09", Ten = "Barzdukas", MaLH = "lh01", MaDVT = "dvt01", NgaySanXuat = "18/07/1999", SoLuongNhap = 34, SoLuongBan = 23, GiaBan = 24, GiaMua = 10, NgayNhap = DateTime.Parse("2017-09-01")
                },
                new MatHang {
                    MaMH = "mh001", Ten = "Li", MaLH = "lh01", MaDVT = "dvt01", NgaySanXuat = "18/07/1999", SoLuongNhap = 34, SoLuongBan = 23, GiaBan = 24, GiaMua = 10, NgayNhap = DateTime.Parse("2017-09-01")
                },
                new MatHang {
                    MaMH = "mh011", Ten = "Justice", MaLH = "lh01", MaDVT = "dvt01", NgaySanXuat = "18/07/1999", SoLuongNhap = 34, SoLuongBan = 23, GiaBan = 24, GiaMua = 10, NgayNhap = DateTime.Parse("2016-09-01")
                },
                new MatHang {
                    MaMH = "mh014", Ten = "Norman", MaLH = "lh01", MaDVT = "dvt01", NgaySanXuat = "18/07/1999", SoLuongNhap = 34, SoLuongBan = 23, GiaBan = 24, GiaMua = 10, NgayNhap = DateTime.Parse("2018-09-01")
                },
                new MatHang {
                    MaMH = "mh017", Ten = "Olivetto", MaLH = "lh01", MaDVT = "dvt01", NgaySanXuat = "18/07/1999", SoLuongNhap = 34, SoLuongBan = 23, GiaBan = 24, GiaMua = 10, NgayNhap = DateTime.Parse("2019-09-01")
                }
            };

            context.MatHangs.AddRange(matHangs);
            context.SaveChanges();
        }
 public ProductController(EShopDBContext context, IProductApplication productApplication)
 {
     _productApplication = productApplication;
     _context            = context;
 }
 public HomeController(EShopDBContext _context)
 {
     this.db = _context;
 }
Example #4
0
 public MangerProductService(EShopDBContext context, IStorageService storageService)
 {
     _context = context;
     _str     = storageService;
 }
 public BaseRepository(EShopDBContext context)
 {
     _context = context;
 }
 public ChucVusController(EShopDBContext context)
 {
     _context = context;
 }
 public ProductRepository(EShopDBContext eShopDBContext) : base(eShopDBContext)
 {
 }
Example #8
0
 public MatHangsController(EShopDBContext context)
 {
     _context = context;
 }
 public SupplierRepository(EShopDBContext context) : base(context)
 {
 }
Example #10
0
 public HoaDonsController(EShopDBContext context)
 {
     _context = context;
 }
 public NhanViensController(EShopDBContext context)
 {
     _context = context;
 }
Example #12
0
 public DonViTinhsController(EShopDBContext context)
 {
     _context = context;
 }
Example #13
0
 public ChungLoaisController(EShopDBContext context)
 {
     _context = context;
 }
Example #14
0
 public ProductRepositoy(EShopDBContext context) : base(context)
 {
 }
Example #15
0
 public ProductService(IProductRepository productRepository, EShopDBContext context, IMapper mapper)
 {
     _productRepository = productRepository;
     _context           = context;
     _mapper            = mapper;
 }
Example #16
0
 public KhachHangsController(EShopDBContext context)
 {
     _context = context;
 }
Example #17
0
 public LoaiHangsController(EShopDBContext context)
 {
     _context = context;
 }
Example #18
0
 public ProductService(EShopDBContext context)
 {
     _context = context;
 }
 public NhaCungCapsController(EShopDBContext context)
 {
     _context = context;
 }