public async Task <IActionResult> Edit(long id, [Bind("KodVidaPolisa,Naimenovanie,Opisanie,Usloviya,KodRiska")] VidyPolisov vidyPolisov)
        {
            if (id != vidyPolisov.KodVidaPolisa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vidyPolisov);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VidyPolisovExists(vidyPolisov.KodVidaPolisa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KodRiska"] = new SelectList(_context.Riski, "KodRiska", "Naimenovanie", vidyPolisov.KodRiska);
            return(View(vidyPolisov));
        }
        public async Task <IActionResult> Create([Bind("KodVidaPolisa,Naimenovanie,Opisanie,Usloviya,KodRiska")] VidyPolisov vidyPolisov)
        {
            if (ModelState.IsValid)
            {
                _context.Add(vidyPolisov);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KodRiska"] = new SelectList(_context.Riski, "KodRiska", "Naimenovanie", vidyPolisov.KodRiska);
            return(View(vidyPolisov));
        }