Пример #1
0
        public async Task <IActionResult> Create([Bind("ID,Name_type")] Types types)
        {
            if (ModelState.IsValid)
            {
                _context.Add(types);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(types));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("ID,DishesID,Q_time,Quantity")] Quantities quantities)
        {
            if (ModelState.IsValid)
            {
                _context.Add(quantities);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DishesID"] = new SelectList(_context.Dishes, "ID", "ID", quantities.DishesID);
            return(View(quantities));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("ID,Name_dish,TypesID,description")] Dishes dishes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dishes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TypesID"] = new SelectList(_context.Types, "ID", "ID", dishes.TypesID);
            return(View(dishes));
        }