Esempio n. 1
0
        public IActionResult OnGet()
        {
            ViewData["CustomerID"] = new SelectList(_context.Set <Customer>(), "ID", "CustomerName");
            var order = new Order();

            order.OrderProducts = new List <OrderProduct>();
            PopulateAssignedProductData(_context, order);
            return(Page());
        }
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Product = await _context.Product.FirstOrDefaultAsync(m => m.ID == id);

            if (Product == null)
            {
                return(NotFound());
            }
            ViewData["PlatformID"] = new SelectList(_context.Set <Platform>(), "ID", "PlatformName");

            return(Page());
        }
Esempio n. 3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Order = await _context.Order.Include(b => b.Customer).Include(b => b.OrderProducts).ThenInclude(b => b.Product).AsNoTracking().FirstOrDefaultAsync(m => m.ID == id);

            if (Order == null)
            {
                return(NotFound());
            }
            PopulateAssignedProductData(_context, Order);
            ViewData["CustomerID"] = new SelectList(_context.Set <Customer>(), "ID", "CustomerName");

            return(Page());
        }
        public IActionResult OnGet()
        {
            ViewData["PlatformID"] = new SelectList(_context.Set <Platform>(), "ID", "PlatformName");

            return(Page());
        }