Example #1
0
        public async Task <IActionResult> Create([Bind("IdTaxa,Pret,DescriereTaxa")] Taxa taxa)
        {
            if (ModelState.IsValid)
            {
                _context.Add(taxa);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(taxa));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("IdCamin,Adresa,NrCamere,Poza,BaieComuna,BucatarieComuna,IdTaxa")] Camin camin)
        {
            if (ModelState.IsValid)
            {
                _context.Add(camin);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdTaxa"] = new SelectList(_context.Taxa, "IdTaxa", "IdTaxa", camin.IdTaxa);
            return(View(camin));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("Cnp,Nume,Prenume,NrTelefon,Facultate,AnStudiu,Medie,Sex,Varsta,Email,LuniRestante,Statut,IdCamera")] Student student)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCamera"] = new SelectList(_context.Camera, "IdCamera", "IdCamera", student.IdCamera);
            return(View(student));
        }
Example #4
0
        public async Task <IActionResult> Create([Bind("IdCamera,Etaj,NrPaturi,NrMobilier,IdCamin")] Camera camera)
        {
            if (ModelState.IsValid)
            {
                _context.Add(camera);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCamin"] = new SelectList(_context.Camin, "IdCamin", "Adresa", camera.IdCamin);
            return(View(camera));
        }
Example #5
0
        public async Task <IActionResult> Create([Bind("IdAdministrator,Nume,Prenume,NrTelefon,Email,IdCamin")] Administrator administrator)
        {
            if (ModelState.IsValid)
            {
                _context.Add(administrator);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCamin"] = new SelectList(_context.Camin, "IdCamin", "Adresa", administrator.IdCamin);
            return(View(administrator));
        }