Example #1
0
        //Our Programmes Page
        public ActionResult Program()
        {
            Session["menu"] = 5;
            var ls = new ProgramImageDao(_provider).GetAll().Where(w => w.Program.ProHide == false && w.ImgMain == true).ToList();

            return(View(ls));
        }
        //method delete image
        public ActionResult DelImg(int id)
        {
            ProgramImageDTO pi       = new ProgramImageDao(_unitOfWork).GetByid(id);
            string          fullPath = Request.MapPath("~/FileImage/" + pi.ImgFileName);

            if (System.IO.File.Exists(fullPath))
            {
                System.IO.File.Delete(fullPath);
            }
            new ProgramImageDao(_unitOfWork).Delete(id);
            return(RedirectToAction("IndexPi", new { id = pi.ProID }));
        }