Exemplo n.º 1
0
        public ActionResult RemoveImg(int imgid, string imgpath, string imgname)
        {
            string             imgresult          = string.Empty;
            bool               isDeleted          = false;
            RecruitmentService recruitmentservice = new RecruitmentService();

            isDeleted = recruitmentservice.DeleteDocumentFile(imgid);
            if (isDeleted)
            {
                //Remove file from Phyical Location
                string newFileName = Path.Combine(Server.MapPath("~" + ConfigurationManager.AppSettings["RecruitDocument"]), imgname);
                if (System.IO.File.Exists(newFileName))
                {
                    System.IO.File.Delete(newFileName);
                }
                imgresult = "Image Remove Successfully!";
            }
            else
            {
                imgresult = "Image Not Remove";
            }

            return(Json(imgresult, JsonRequestBehavior.AllowGet));
        }