Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("IdCity,NameCity")] City city)
        {
            if (ModelState.IsValid)
            {
                _context.Add(city);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(city));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("IdMenu,NameDose,Description,Price,ImageUri,Categorya")] Menu menu)
        {
            if (ModelState.IsValid)
            {
                _context.Add(menu);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(menu));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("IdOrder,IdClub,IdMenu,DateForDay,Count")] Order order)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdMenu"] = new SelectList(_context.Menu, "IdMenu", "IdMenu", order.IdMenu);
            return(View(order));
        }