Example #1
0
        public ActionResult Index()
        {
            Korosztaly korosztaly      = new Korosztaly();
            var        sportLista      = _context.Sportok.ToList();
            var        korosztalyLista = korosztaly.korosztalyLista;

            HirdetesAddViewModel model = new HirdetesAddViewModel();

            model.Sport          = sportLista;
            model.KrosztalyLista = korosztalyLista;
            return(View("Index", model));
        }
Example #2
0
        public ActionResult Edit(int id)
        {
            if (id == 0)
            {
                return(HttpNotFound());
            }
            var        letezoHirdetes = _context.Hirdetesek.Single(u => u.Id == id);
            var        sportLista     = _context.Sportok.ToList();
            Korosztaly korosztaly     = new Korosztaly();
            var        vm             = new HirdetesAddViewModel()
            {
                sportHirdetes  = letezoHirdetes,
                Sport          = sportLista,
                KrosztalyLista = korosztaly.korosztalyLista
            };

            return(View("UjHirdetes", vm));
        }