예제 #1
0
 public IActionResult OnGet()
 {
     ViewData["CustomerId"] = new SelectList(_context.Customers, "CustomerId", "CustomerId");
     ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeID", "FullName");
     ViewData["ShipVia"]    = new SelectList(_context.Set <Shipper>(), "ShipperId", "CompanyName");
     return(Page());
 }
예제 #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            OrderDetail = await _context.OrderDetail
                          .Include(o => o.Order)
                          .Include(o => o.Product).FirstOrDefaultAsync(m => m.OrderId == id);

            if (OrderDetail == null)
            {
                return(NotFound());
            }
            ViewData["OrderId"]   = new SelectList(_context.Order, "OrderId", "OrderId");
            ViewData["ProductId"] = new SelectList(_context.Set <Product>(), "ProductId", "ProductId");
            return(Page());
        }
예제 #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Order = await _context.Order
                    .Include(o => o.Customer)
                    .Include(o => o.Employee)
                    .Include(o => o.ShipViaNavigation).FirstOrDefaultAsync(m => m.OrderId == id);

            if (Order == null)
            {
                return(NotFound());
            }
            ViewData["CustomerId"] = new SelectList(_context.Customers, "CustomerId", "CustomerId");
            ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeID", "FullName");
            ViewData["ShipVia"]    = new SelectList(_context.Set <Shipper>(), "ShipperId", "CompanyName");
            return(Page());
        }
예제 #4
0
 public IActionResult OnGet()
 {
     ViewData["OrderId"]   = new SelectList(_context.Order, "OrderId", "OrderId");
     ViewData["ProductId"] = new SelectList(_context.Set <Product>(), "ProductId", "ProductId");
     return(Page());
 }