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()); }
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", "Name"); ViewData["TypeProductID"] = new SelectList(_context.Set <TypeProduct>(), "TypeProductID", "Name"); return(Page()); }
public IActionResult OnGet() { ViewData["BrandID"] = new SelectList(_context.Brand, "BrandID", "Name"); ViewData["TypeProductID"] = new SelectList(_context.Set <TypeProduct>(), "TypeProductID", "Name"); return(Page()); }
public IActionResult OnGet() { ViewData["BillID"] = new SelectList(_context.Bill, "BillID", "CodeBill"); ViewData["ProductID"] = new SelectList(_context.Set <Product>(), "ProductID", "Code"); return(Page()); }