public async Task <IActionResult> Create([Bind("Id,employeeId,kompaniskaSmetkaId,tip")] EmployeeFirms employeeFirms)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employeeFirms);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["kompaniskaSmetkaId"] = new SelectList(_context.KompaniskaSmetka, "Id", "bankarskiBroj", employeeFirms.kompaniskaSmetkaId);
            ViewData["employeeId"]         = new SelectList(_context.Employee, "Id", "FullName", employeeFirms.employeeId);
            return(View(employeeFirms));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,firstName,lastName,birthDate,Address")] Korisnik korisnik)
        {
            if (ModelState.IsValid)
            {
                _context.Add(korisnik);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(korisnik));
        }
        public async Task <IActionResult> Create([Bind("Id,firstName,lastName,birthDate,Position")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
        public async Task <IActionResult> Create([Bind("Id,firmName,dataOsnovanje,Address")] Firma firma)
        {
            if (ModelState.IsValid)
            {
                _context.Add(firma);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(firma));
        }
Beispiel #5
0
        public async Task <IActionResult> Create([Bind("Id,bankarskiBroj,paricnaSostojba,dataIzdavanje,tip,korisnikId")] KorisnickaSmetka korisnickaSmetka)
        {
            if (ModelState.IsValid)
            {
                _context.Add(korisnickaSmetka);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["korisnikId"] = new SelectList(_context.Korisnik, "Id", "FullName", korisnickaSmetka.korisnikId);
            return(View(korisnickaSmetka));
        }
        public async Task <IActionResult> Create([Bind("Id,brojNaKarticka,tipNaKarticka,paricnaSostojba,korisnickaSmetkaId")] Karticka karticka)
        {
            if (ModelState.IsValid)
            {
                _context.Add(karticka);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["korisnickaSmetkaId"] = new SelectList(_context.KorisnickaSmetka, "Id", "bankarskiBroj", karticka.korisnickaSmetkaId);
            return(View(karticka));
        }