예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,OpisUsterki,Aktywne,IdSamochodu,IdMechanika")] Zlecenie zlecenie)
        {
            if (ModelState.IsValid)
            {
                _context.Add(zlecenie);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(zlecenie));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,Imie,Nazwisko")] Mechanik mechanik)
        {
            if (ModelState.IsValid)
            {
                _context.Add(mechanik);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(mechanik));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Id,Marka,Model,Rejestracja,Vin,KlientId")] Samochod samochod)
        {
            if (ModelState.IsValid)
            {
                _context.Add(samochod);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KlientId"] = new SelectList(_context.Klients, "Id", "Id", samochod.KlientId);
            return(View(samochod));
        }
예제 #4
0
 public void Add(Products newproduct)
 {
     _context.Add(newproduct);
     _context.SaveChanges();
 }