public static DataTable GetAllSuperNodeIDs(string TableName, string IDName, string LowIDName, string IDs) { string CacheKey = "Cache-TreeTableBLL-GetAllSuperNodeIDs-" + TableName + "-" + IDs; DataTable dt = (DataTable)DataCache.GetCache(CacheKey); if (dt == null) { dt = Tools.ConvertDataReaderToDataTable(TreeTableDAL.GetAllSuperNodeIDs(TableName, IDName, LowIDName, IDs)); #region 写入缓存 int ModelCache = ConfigHelper.GetConfigInt("ModelCache"); DataCache.SetCache(CacheKey, dt, DateTime.Now.AddMinutes(ModelCache), Cache.NoSlidingExpiration); #endregion } return(dt); }
/// <summary> /// 获取指定节点的所有从根到本节点的全路径名称 /// </summary> /// <param name="TableName"></param> /// <param name="IDName"></param> /// <param name="NameColumnName"></param> /// <param name="SuperIDName"></param> /// <param name="RootID"></param> /// <param name="ID"></param> /// <returns></returns> public static string GetFullPathName(string TableName, string IDName, string NameColumnName, string SuperIDName, int RootID, int ID) { string CacheKey = "Cache-TreeTableBLL-GetFullPathName-" + TableName + "-" + IDName + "-" + NameColumnName + "-" + SuperIDName + "-" + RootID.ToString() + "-" + ID.ToString(); string fullname = (string)DataCache.GetCache(CacheKey); if (fullname == null) { fullname = TreeTableDAL.GetFullPathName(TableName, IDName, NameColumnName, SuperIDName, RootID, ID); #region 写入缓存 int ModelCache = ConfigHelper.GetConfigInt("ModelCache"); DataCache.SetCache(CacheKey, fullname, DateTime.Now.AddMinutes(ModelCache), Cache.NoSlidingExpiration); #endregion } return(fullname); }
/// <summary> /// get relation value of the special fieldname of the table /// </summary> /// <param name="TableName"></param> /// <param name="KeyName"></param> /// <param name="ValueName"></param> /// <returns></returns> public static DataTable GetRelationTableSourceData(string TableName, string KeyName, string ValueName) { string CacheKey = "Cache-TreeTableBLL-GetRelationTableSourceData-" + TableName + "-" + TableName + "-" + KeyName + "-" + ValueName; DataTable dt = (DataTable)DataCache.GetCache(CacheKey); if (dt == null) { dt = Tools.ConvertDataReaderToDataTable(TreeTableDAL.GetRelationTableSourceData(TableName, KeyName, ValueName)); #region 写入缓存 if (dt.Rows.Count < 10000) //1万行以下的才进行缓存 { int ModelCache = ConfigHelper.GetConfigInt("ModelCache"); DataCache.SetCache(CacheKey, dt, DateTime.Now.AddMinutes(ModelCache), Cache.NoSlidingExpiration); } #endregion } return(dt); }
/// <summary> /// 获取指定表里Key值对应的Value列的值 /// </summary> /// <param name="TableName">表名</param> /// <param name="KeyName">ID列名</param> /// <param name="ValueName">Name列名</param> /// <param name="KeyValue">ID值</param> /// <returns></returns> public static string GetRelationTableDataValue(string TableName, string KeyName, string ValueName, string KeyValue) { if (string.IsNullOrEmpty(KeyValue)) { return(""); } string CacheKey = "Cache-TreeTableBLL-GetRelationTableDataValue-" + TableName + "-" + TableName + "-" + KeyName + "-" + ValueName + "-" + KeyValue; string s = (string)DataCache.GetCache(CacheKey); if (string.IsNullOrEmpty(s)) { s = TreeTableDAL.GetRelationTableDataValue(TableName, KeyName, ValueName, KeyValue); #region 写入缓存 int ModelCache = ConfigHelper.GetConfigInt("ModelCache"); DataCache.SetCache(CacheKey, s, DateTime.Now.AddMinutes(ModelCache), Cache.NoSlidingExpiration); #endregion } return(s); }
public static int ExecSqlStringByTotalCount(string DBConnectString, string SqlString, out int TotalRecordCount) { return(TreeTableDAL.ExecSqlStringByTotalCount(DBConnectString, SqlString, out TotalRecordCount)); }
public static DataTable ExecSqlString(string DBConnectString, string SqlString, int PageSize, int PageIndex, string OrderFields, out int TotalRecordCount) { return(TreeTableDAL.ExecSqlString(DBConnectString, SqlString, PageSize, PageIndex, OrderFields, out TotalRecordCount)); }
public static DataTable ExecSqlString(string SqlString, int PageSize, int PageIndex, out int TotalRecordCount) { return(TreeTableDAL.ExecSqlString(SqlString, PageSize, PageIndex, out TotalRecordCount)); }
/// <summary> /// 获取指定节点的所有从根到本节点的全路径名称 /// </summary> /// <param name="TableName"></param> /// <param name="ID"></param> /// <returns></returns> public static string GetFullPathName(string TableName, int ID) { return(TreeTableDAL.GetFullPathName(TableName, ID)); }
/// <summary> /// 获取某节点的子节点(只获取一层子节点) /// </summary> /// <param name="TableName"></param> /// <param name="IDName"></param> /// <param name="SuperIDName"></param> /// <param name="ID"></param> /// <returns></returns> public static DataTable GetChild(string TableName, string IDName, string SuperIDName, int ID) { return(Tools.ConvertDataReaderToDataTable(TreeTableDAL.GetChild(TableName, IDName, SuperIDName, ID))); }
/// <summary> /// 获取某节点的完整路径 /// </summary> /// <param name="TableName"></param> /// <param name="IDName"></param> /// <param name="SuperIDName"></param> /// <param name="RootID"></param> /// <param name="ID"></param> /// <returns></returns> public static DataTable GetFullPath(string TableName, string IDName, string SuperIDName, int RootID, int ID) { return(Tools.ConvertDataReaderToDataTable(TreeTableDAL.GetFullPath(TableName, IDName, SuperIDName, RootID, ID))); }