public object DeleteDefinfLink(string id) { var tran = Utility.Database.BeginDbTransaction(); try { B_OA_FileType_DefineLink fileType = new B_OA_FileType_DefineLink(); fileType.Condition.Add("id = " + id); Utility.Database.Delete(fileType, tran); Utility.Database.Commit(tran); return Utility.JsonMsg(true, "删除成功"); } catch (Exception ex) { Utility.Database.Rollback(tran); ComBase.Logger(ex); //写异常日志到本地文件夹 throw (new Exception("删除失败!", ex)); } }
public object GetDocDefinition(string userid) { var tran = Utility.Database.BeginDbTransaction(); StringBuilder strSql = new StringBuilder(); try { strSql.AppendFormat(@" SELECT CASE WHEN isEffective = '1' THEN '有效' WHEN isEffective = '0' THEN '无效' ELSE '未知' END AS isEffectiveName ,* FROM B_OA_FileType_DefineLink ORDER BY sort DESC "); DataTable dt = Utility.Database.ExcuteDataSet(strSql.ToString()).Tables[0]; B_OA_FileType_DefineLink defindLink = new B_OA_FileType_DefineLink(); return new { dt = dt, defindLink = defindLink }; } catch (Exception ex) { Utility.Database.Rollback(tran); ComBase.Logger(ex); //写异常日志到本地文件夹 throw (new Exception("获取数据失败!", ex)); } }