Example #1
0
        public async Task <IActionResult> Create([Bind("KlientiId,Emri,Mbiemri,NumriTelefonit,Email")] Klienti klienti)
        {
            if (ModelState.IsValid)
            {
                _context.Add(klienti);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(klienti));
        }
        public async Task <IActionResult> Create([Bind("RoliId,Roli1")] Roli roli)
        {
            if (ModelState.IsValid)
            {
                _context.Add(roli);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(roli));
        }
        public async Task <IActionResult> Create([Bind("VendoriId,Emri,Lokacioni,NrKontaktues,BankAccount")] Vendori vendori)
        {
            if (ModelState.IsValid)
            {
                _context.Add(vendori);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(vendori));
        }
        public async Task <IActionResult> Create([Bind("PunetoriId,Emri,Mbiemri,Gjinia,RoliId,NumriPersonal")] Punetori punetori)
        {
            if (ModelState.IsValid)
            {
                _context.Add(punetori);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RoliId"] = new SelectList(_context.Roli, "RoliId", "RoliId", punetori.RoliId);
            return(View(punetori));
        }