/// <summary> /// 根据字典类别和字典的key值获取字典项(字典必须可用) /// </summary> /// <param name="categoryName"></param> /// <param name="key"></param> /// <returns></returns> public SystemDictionaryEntity GetDictionaryByCategoryNameAndKey(string categoryName, string key) { NHibernateDynamicQueryGenerator <SystemDictionaryEntity> dynamicQueryGenerator = this.GetNewQueryBuilder(); dynamicQueryGenerator.AddWhereClause(PROPERTY_SYSTEMDICTIONARYCATEGORYID.Eq(categoryName)); dynamicQueryGenerator.AddWhereClause(PROPERTY_SYSTEMDICTIONARYISENABLE.Eq(true)); dynamicQueryGenerator.AddWhereClause(PROPERTY_SYSTEMDICTIONARYKEY.Eq(key)); return(this.FindSingleEntityByQueryBuilder(dynamicQueryGenerator)); }
public List <SystemDictionaryEntity> FindAllByGroupIdAndOrder() { NHibernateDynamicQueryGenerator <SystemDictionaryEntity> dynamicQueryGenerator = this.GetNewQueryBuilder(); dynamicQueryGenerator.AddWhereClause(PROPERTY_SYSTEMDICTIONARYISENABLE.Eq(true)); dynamicQueryGenerator.AddOrderBy(PROPERTY_SYSTEMDICTIONARYGROUPID.Asc()); dynamicQueryGenerator.AddOrderBy(PROPERTY_SYSTEMDICTIONARYORDER.Asc()); return(this.FindListByQueryBuilder(dynamicQueryGenerator)); }
/// <summary> /// 根据字典类别名获取该类别下的所有可用的字典项(已排序) /// </summary> /// <param name="categoryName"></param> /// <returns></returns> public IList <SystemDictionaryEntity> GetDictionaryByCategoryName(string categoryName) { NHibernateDynamicQueryGenerator <SystemDictionaryEntity> dynamicQueryGenerator = this.GetNewQueryBuilder(); dynamicQueryGenerator.AddWhereClause(PROPERTY_SYSTEMDICTIONARYCATEGORYID.Eq(categoryName)); dynamicQueryGenerator.AddWhereClause(PROPERTY_SYSTEMDICTIONARYISENABLE.Eq(true)); dynamicQueryGenerator.AddOrderBy(PROPERTY_SYSTEMDICTIONARYORDER.Asc()); return(this.FindListByQueryBuilder(dynamicQueryGenerator)); }
/// <summary> /// 根据字典类别和字典的key值获取字典项(字典必须可用) /// </summary> /// <param name="categoryName"></param> /// <param name="key"></param> /// <returns></returns> public SystemDictionaryEntity GetDictionaryByGroupIDAndKey(SystemDictionaryGroupEntity dictionaryGroup, string key) { NHibernateDynamicQueryGenerator <SystemDictionaryEntity> dynamicQueryGenerator = this.GetNewQueryBuilder(); dynamicQueryGenerator.AddWhereClause(PROPERTY_SYSTEMDICTIONARYGROUPID.Eq(dictionaryGroup)); dynamicQueryGenerator.AddWhereClause(PROPERTY_SYSTEMDICTIONARYISENABLE.Eq(true)); dynamicQueryGenerator.AddWhereClause(PROPERTY_SYSTEMDICTIONARYKEY.Eq(key)); return(this.FindSingleEntityByQueryBuilder(dynamicQueryGenerator)); }