private string DeleteSoftware(string id) { Sys_Software software = sfbll.Find(s => s.SoftwareID == id); // 并不真实删除表中数据,仅仅更新字段,并保留删除信息 software.Software_IsExists = 1; software.Software_DeleteTime = DateTime.Now; software.Software_DeleteUserID = CurrUserInfo().UserID; string msg = string.Empty; bool bol = sfbll.Update(software, out msg); // 得到ModelFile表中对象。 var file = bll.Find(m => m.File_OperationID == id); FileDeleHandler fdh = new FileDeleHandler(); // 删除Download中的文件 string Result = fdh.PublicDele(file.FileID, "ww", file.File_Type); bll.Delete(file); return(Result); }
public string InitTable() { List <Sys_Software> lst = bll.FindWhere(s => s.Software_IsExists == 0).OrderBy(s => s.Software_No).ToList(); StringBuilder str = new StringBuilder(); str.AppendLine("<table style=\"width:80%; margin-left:9%;margin-top:20px;\" class=\"tab\" border=\"0\" cellpadding=\"10\" cellspacing=\"1\">"); str.AppendLine("<thead style=\"background-color: #ddd;\">"); str.AppendLine("<tr style=\"height:30px;\"> <th style=\"width:80px;\">软件名称</th><th style=\"width:268px;\">软件介绍</th><th style=\"width:30px;\">下载连接</th></tr>"); str.AppendLine("</thead>"); str.AppendLine("<tbody style=\"background-color: rgba(245, 245, 245, 0.89); text-align:center; font-size:13px;font-family:'Microsoft YaHei';\">"); foreach (var item in lst) { Sys_ModelFile file = smbll.Find(f => f.File_OperationID == item.SoftwareID); //string json = file.File_Path + "&" + file.File_Name; str.AppendLine("<tr><td>" + item.Software_Name + "</td><td style=\"text-align:left;\">" + item.Software_Introduction + "</td><td><a href='/Files/Download.aspx?path=" + file.File_Path + "&filename=" + file.File_Name + "'>下载</a></td></tr>"); } str.AppendLine("</tbody>"); str.AppendLine("</table>"); return(str.ToString()); }