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