public async Task <IActionResult> Create([Bind("Id,Nume,Prenume,Cnp,Permis,Cazier")] PersoanePolitie persoanePolitie)
        {
            if (ModelState.IsValid)
            {
                _context.Add(persoanePolitie);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(persoanePolitie));
        }
        public async Task <IActionResult> Create([Bind("Cnp,Nume,Prenume,Serie,Numar,Adresa,Oras,DataNasterii,StatusPolitie,StatusMedic,StatusUniversitate")] Persoane persoane)
        {
            if (ModelState.IsValid)
            {
                _context.Add(persoane);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(persoane));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("Id,NumeInstitutie")] Institutii institutii)
        {
            if (ModelState.IsValid)
            {
                _context.Add(institutii);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(institutii));
        }
        public async Task <IActionResult> Create([Bind("Id,Nume,Prenume,Cnp,Facultate,Specializare,Stadiu,An")] StudentiUniversitate studentiUniversitate)
        {
            if (ModelState.IsValid)
            {
                _context.Add(studentiUniversitate);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(studentiUniversitate));
        }
        public async Task <IActionResult> Create([Bind("Id,Nume,Prenume,Cnp,BoliCronice")] PersoaneMedic persoaneMedic)
        {
            if (ModelState.IsValid)
            {
                _context.Add(persoaneMedic);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(persoaneMedic));
        }
        public async Task <IActionResult> Create([Bind("Id,UserId,TipCerere,InstitutieId,Status,Data")] Cereri cereri)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cereri);
                await _context.SaveChangesAsync();

                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));
        }