コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nume,Prenume,Cnp,Permis,Cazier")] PersoanePolitie persoanePolitie)
        {
            if (id != persoanePolitie.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(persoanePolitie);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersoanePolitieExists(persoanePolitie.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(persoanePolitie));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(string id, [Bind("Cnp,Nume,Prenume,Serie,Numar,Adresa,Oras,DataNasterii,StatusPolitie,StatusMedic,StatusUniversitate")] Persoane persoane)
        {
            if (id != persoane.Cnp)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(persoane);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersoaneExists(persoane.Cnp))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(persoane));
        }
コード例 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nume,Prenume,Cnp,Facultate,Specializare,Stadiu,An")] StudentiUniversitate studentiUniversitate)
        {
            if (id != studentiUniversitate.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(studentiUniversitate);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StudentiUniversitateExists(studentiUniversitate.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(studentiUniversitate));
        }
コード例 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,NumeInstitutie")] Institutii institutii)
        {
            if (id != institutii.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(institutii);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InstitutiiExists(institutii.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(institutii));
        }
コード例 #5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,UserId,TipCerere,InstitutieId,Status,Data")] Cereri cereri)
        {
            if (id != cereri.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cereri);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CereriExists(cereri.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["InstitutieId"] = new SelectList(_context.Institutii, "Id", "NumeInstitutie", cereri.InstitutieId);
            ViewData["UserId"]       = new SelectList(_context.Persoane, "Cnp", "Cnp", cereri.UserId);
            return(View(cereri));
        }