Example #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ServisStavka = servisStavkaRepository.FindById((int)id);

            if (ServisStavka == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #2
0
        public IActionResult OnPost()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            Servis.ServisStavka = servisStavka.FindById(ServisStavka);
            Servis.Vozilo       = voziloRepo.FindById(Vozilo);
            try
            {
                servrepo.Update(Servis);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ServisExists(Servis.IDServis))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
        public IActionResult OnPost()
        {
            Servis.Vozilo       = voziloRepo.FindById(Vozilo);
            Servis.ServisStavka = servisStavka.FindById(ServisStavka);
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            servrepo.Create(Servis);

            return(RedirectToPage("./Index"));
        }