Пример #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Product = await _context.Product
                      .Include(p => p.Brand)
                      .Include(p => p.TypeProduct).FirstOrDefaultAsync(m => m.ProductID == id);

            if (Product == null)
            {
                return(NotFound());
            }
            ViewData["BrandID"]       = new SelectList(_context.Brand, "BrandID", "Description");
            ViewData["TypeProductID"] = new SelectList(_context.Set <TypeProduct>(), "TypeProductID", "Description");
            return(Page());
        }
Пример #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            DetailBill = await _context.DetailBill
                         .Include(d => d.Bill)
                         .Include(d => d.Product).FirstOrDefaultAsync(m => m.DetailBillID == id);

            if (DetailBill == null)
            {
                return(NotFound());
            }
            ViewData["BillID"]    = new SelectList(_context.Bill, "BillID", "CodeBill");
            ViewData["ProductID"] = new SelectList(_context.Set <Product>(), "ProductID", "Code");
            return(Page());
        }
Пример #3
0
 public IActionResult OnGet()
 {
     ViewData["BillID"]    = new SelectList(_context.Bill, "BillID", "CodeBill");
     ViewData["ProductID"] = new SelectList(_context.Set <Product>(), "ProductID", "Code");
     return(Page());
 }
Пример #4
0
 public IActionResult OnGet()
 {
     ViewData["BrandID"]       = new SelectList(_context.Brand, "BrandID", "Description");
     ViewData["TypeProductID"] = new SelectList(_context.Set <TypeProduct>(), "TypeProductID", "Description");
     return(Page());
 }