Пример #1
0
 public MutiSelectDescriptor DataSource(string dictionaryType, SourceType sourceType)
 {
     this.SourceKey  = dictionaryType;
     this.SourceType = sourceType;
     if (sourceType == SourceType.Dictionary)
     {
         IDataDictionaryService dicService = ServiceLocator.GetService <IDataDictionaryService>();
         if (dicService != null)
         {
             if (this._data == null)
             {
                 _data = new Dictionary <string, string>();
             }
             var dicts = dicService.Get(m => m.DicName == dictionaryType).ToList();
             foreach (DataDictionaryEntity item in dicts)
             {
                 this._data.Add(item.ID.ToString(), item.Title);
             }
         }
     }
     return(this);
 }