public IActionResult Sil(string Id)
        {
            var news = newsDb.GetOneById(Id);

            if (news.Photo != "defaultnews.png")
            {
                if (System.IO.File.Exists(Directory.GetCurrentDirectory() + "\\wwwroot\\Haberler\\" + news.Photo))
                {
                    System.IO.File.Delete(Directory.GetCurrentDirectory() + "\\wwwroot\\Haberler\\" + news.Photo);
                }
            }
            newsDb.Delete(news);
            TempData["DeleteMessage"] = "Haber Başarıyla Silindi.";
            return(RedirectToAction("Index", "YoneticiHaber"));
        }
Esempio n. 2
0
        public IActionResult Sil(string Id)
        {
            var team = teamDb.GetOneById(Id);

            if (team.Photo != "defaultteam.png")
            {
                if (System.IO.File.Exists(Directory.GetCurrentDirectory() + "\\wwwroot\\Ekip\\" + team.Photo))
                {
                    System.IO.File.Delete(Directory.GetCurrentDirectory() + "\\wwwroot\\Ekip\\" + team.Photo);
                }
            }
            teamDb.Delete(team);
            TempData["DeleteMessage"] = "Üye Başarıyla Silindi.";
            return(RedirectToAction("Index"));
        }
        public IActionResult Sil(string Id)
        {
            var gallery = galleryDb.GetOneById(Id);

            if (gallery.Photo != "defaultgallery.png")
            {
                if (System.IO.File.Exists(Directory.GetCurrentDirectory() + "\\wwwroot\\Galeri\\" + gallery.Photo))
                {
                    System.IO.File.Delete(Directory.GetCurrentDirectory() + "\\wwwroot\\Galeri\\" + gallery.Photo);
                }
            }
            galleryDb.Delete(gallery);
            TempData["DeleteMessage"] = "Fotoğraf Başarıyla Silindi.";
            return(RedirectToAction("Index", "YoneticiGaleri"));
        }
Esempio n. 4
0
 public ActionResult Delete(string Id, Movie movie)
 {
     movieDb.Delete(movie);
     return(RedirectToAction("Index", "Home"));
 }
Esempio n. 5
0
 public IActionResult Delete(string Id, Blog blog)
 {
     blogDb.Delete(blog);
     return(RedirectToAction("Index", "Admin"));
 }
Esempio n. 6
0
 public ActionResult Delete(string Id, Director director)
 {
     directorDb.Delete(director);
     return(RedirectToAction("Index", "Home"));
 }