public ActionResult Detail(int id, bool?zobrazPopis)
        {
            HokejistaDao hokejistaDao = new HokejistaDao();
            Hokejista    h            = hokejistaDao.GetById(id);

            return(View(h));
        }
Exemple #2
0
        public ActionResult Detail(int id, bool?zobrazPopis)
        {
            HokejistaDao hokejistaDao = new HokejistaDao();
            Hokejista    h            = hokejistaDao.GetById(id);

            if (Request.IsAjaxRequest())
            {
                return(PartialView(h));
            }

            //  ViewBag.ZobrazPopis = zobrazPopis;
            return(View(h));
        }
Exemple #3
0
        public ActionResult EditTrener(int id)
        {
            HokejistaDao     hokejistaDao     = new HokejistaDao();
            HokejistaLigaDao hokejistaLigaDao = new HokejistaLigaDao();
            HokejistaPostDao hokejistaPostDao = new HokejistaPostDao();

            Hokejista h = hokejistaDao.GetById(id);

            ViewBag.Ligy  = hokejistaLigaDao.GetAll();
            ViewBag.Posty = hokejistaPostDao.GetAll();

            return(View(h));
        }
Exemple #4
0
        public ActionResult Delete(int id)
        {
            try
            {
                HokejistaDao hokejistaDao = new HokejistaDao();
                Hokejista    hokejista    = hokejistaDao.GetById(id);
                if (!string.IsNullOrEmpty(hokejista.ImageName))
                {
                    System.IO.File.Delete(Server.MapPath("~/uploads/hokejista/" + hokejista.ImageName));
                }


                hokejistaDao.Delete(hokejista);
                TempData["message-success"] = "Hráč " + hokejista.Jmeno + " byl smazán.";
            }
            catch (Exception exception)
            {
                throw;
            }
            return(RedirectToAction("Index", "Players"));
        }