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

            PutniNalog = repo.FindAll().FirstOrDefault(m => m.IDPutniNalog == id);
            Vozaci     = vozacRepo.FindAll().Select(x => new SelectListItem
            {
                Value = x.IDVozac.ToString(),
                Text  = $"{x.Ime} {x.Prezime}"
            }).ToList();
            Vozila = voziloRepo.FindAll().Select(x => new SelectListItem
            {
                Value = x.IDVozilo.ToString(),
                Text  = $"{x.Tip} {x.Marka}"
            }).ToList();
            Vozac  = PutniNalog.Vozac.IDVozac;
            Vozilo = PutniNalog.Vozilo.IDVozilo;
            if (PutniNalog == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }



            if (Vozac != null)
            {
                if (!putniRepo.FindAll().Any(x => x.Vozac.IDVozac == Vozac.IDVozac))
                {
                    repo.Delete(Vozac);
                }
                else
                {
                }
            }

            return(RedirectToPage("./Index"));
        }
コード例 #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PutniNalog = repo.FindAll().FirstOrDefault(m => m.IDPutniNalog == id);

            if (PutniNalog == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #4
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PutniNalog = repo.FindAll().FirstOrDefault(m => m.IDPutniNalog == id);
            /*await _context.Vozaci.FirstOrDefaultAsync(m => m.IDVozac == id);*/

            if (PutniNalog == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #5
0
 public void OnPost()
 {
     repo.InsertTestCase();
     PutniNalog = repo.FindAll().ToList();
 }