Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,Name,PhoneNumber,Address")] Supplier supplier)
        {
            if (ModelState.IsValid)
            {
                _context.Add(supplier);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(supplier));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Name,Rate")] Movie movie)
        {
            if (ModelState.IsValid)
            {
                _context.Add(movie);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(movie));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("CustomerId,ID,Name,Age,City,PhoneNumber")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
        public async Task <IActionResult> Create([Bind("ID,BrnachName,OpeningHours,Longitude,Latitude")] StoreBranch storeBranch)
        {
            if (ModelState.IsValid)
            {
                _context.Add(storeBranch);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(storeBranch));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("ID,Title,ReleaseDate,Genre,Price,Director,Length,MinimalAge,SupplierId")] Movie movie)
        {
            if (ModelState.IsValid)
            {
                _context.Add(movie);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewBag.AuthorId = new SelectList(_context.Supplier, "ID", "Name", movie.SupplierId);
            //PopulateSuppliersDropDownList(movie.SupplierId);
            return(View(movie));
        }