예제 #1
0
 public bool Delete(Guid id)
 {
     try
     {
         dc.File_Delete(id);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
예제 #2
0
 public ActionResult Drop(Guid?id, FormCollection collection)
 {
     try
     {
         dc.File_Delete(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         ViewBag.Message = "Delete failure";
         var file = dc.Files.Where(x => x.Id == id).Select(m => new Blog.Models.File {
             Id = m.Id, Name = m.Name, Type = m.Type, Size = m.Size
         }).FirstOrDefault();
         if (Request.IsAjaxRequest())
         {
             return(PartialView(file));
         }
         return(View(file));
     }
 }
예제 #3
0
 public ActionResult Drop(Guid?id, FormCollection collection)
 {
     try
     {
         dc.File_Delete(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         ViewBag.Message = "خطا در حذف فایل";
         var file = dc.Files.Where(x => x.Id == id).Select(m => new MusicProduction.Models.File {
             Id = m.Id, عنوان = m.عنوان, حجم = m.حجم, نوع = m.نوع
         }).FirstOrDefault();
         if (Request.IsAjaxRequest())
         {
             return(PartialView(file));
         }
         return(View(file));
     }
 }