public void DownLoadBackups(string id) { B_Backups b_backup = new B_Backups(); var data = b_backup.Get(Convert.ToInt32(id)); string filename = Server.UrlDecode(data.fileName); string filepath = Server.MapPath(data.filePath); if (FileDownHelper.FileExists(filepath)) { FileDownHelper.DownLoadold(filepath, filename); } }
public JsonResult DelBackups(string ids) { Common.Json json = new Common.Json(); B_Backups b_backup = new B_Backups(); B_Manager b_mananger = new B_Manager(); foreach (var id in ids.Split(new char[] { ',' })) { var model = b_backup.Get(Convert.ToInt32(id)); string filepath = Server.MapPath(model.filePath); if (FileDownHelper.FileExists(filepath)) { FileHelper.DeleteFile(filepath); } model.delManager = b_mananger.Get(Convert.ToInt32(base.User.Identity.Name)); model.delTime = DateTime.Now; b_backup.Update(model); } json.msg = "成功删除" + ids.Split(new char[] { ',' }).Length + "个备份!"; return(Json(json)); }