Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("KlientiId,Emri,Mbiemri,NumriTelefonit,Email")] Klienti klienti)
        {
            if (id != klienti.KlientiId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(klienti);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KlientiExists(klienti.KlientiId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(klienti));
        }
        public async Task <IActionResult> Edit(int id, [Bind("RoliId,Roli1")] Roli roli)
        {
            if (id != roli.RoliId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(roli);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RoliExists(roli.RoliId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(roli));
        }
        public async Task <IActionResult> Edit(int id, [Bind("VendoriId,Emri,Lokacioni,NrKontaktues,BankAccount")] Vendori vendori)
        {
            if (id != vendori.VendoriId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vendori);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VendoriExists(vendori.VendoriId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(vendori));
        }
        public async Task <IActionResult> Edit(int id, [Bind("PunetoriId,Emri,Mbiemri,Gjinia,RoliId,NumriPersonal")] Punetori punetori)
        {
            if (id != punetori.PunetoriId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(punetori);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PunetoriExists(punetori.PunetoriId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RoliId"] = new SelectList(_context.Roli, "RoliId", "RoliId", punetori.RoliId);
            return(View(punetori));
        }