Exemplo n.º 1
0
        public ActionResult slettprodukt(int id)
        {
            var    Kundebll = new KundeBLL();
            string bilde    = Kundebll.getpath(id);
            string map      = Kundebll.getkate(bilde);
            string path     = System.IO.Path.Combine(Server.MapPath("~/Bilder/" + map), bilde);

            if (System.IO.File.Exists(path))
            {
                System.IO.File.Delete(path);
            }
            if (Kundebll.slettprodukt(id))
            {
                return(RedirectToAction("ListAlleProdukter"));
            }
            else
            {
                return(HttpNotFound());
            }
        }