private void LoadDictionaryByCategory(List <string> categoryNames) { List <string> tempList = CheckCategory(categoryNames); if (tempList.Count > 0) { ObservableCollection <string> categorys = new ObservableCollection <string>(); foreach (var item in tempList) { categorys.Add(item); } if (V_DictionaryInfoVM.IsExists(categorys.ToList()) == false) { _client.GetDictionaryByCategoryArrayAsync(categorys); } else { GetDictionaryInfoByLocal(); } } else { if (this.OnDictionaryLoadCompleted != null) { OnDictionaryLoadCompleted(this, new OnDictionaryLoadArgs() { Result = true, Error = null }); } } }
private void GetDictionaryInfoByLocal() { List <V_Dictionary> dicts = new List <V_Dictionary>(); List <V_DictionaryInfo> LocalDictionaryInfos = V_DictionaryInfoVM.GetAllV_DictionaryInfo(); foreach (var item in LocalDictionaryInfos) { V_Dictionary dict = SMT.SAAS.Main.CurrentContext.Common.CloneObject <V_DictionaryInfo, V_Dictionary>(item, new V_Dictionary()); dicts.Add(dict); } SaveDictionary(dicts); }
private void SaveDictionaryInfoByLocal(bool bIsSaveAll, List <T_SYS_DICTIONARY> dicts) { List <V_DictionaryInfo> LocalDictionaryInfos = new List <V_DictionaryInfo>(); foreach (var item in dicts) { V_DictionaryInfo dict = SMT.SAAS.Main.CurrentContext.Common.CloneObject <T_SYS_DICTIONARY, V_DictionaryInfo>(item, new V_DictionaryInfo()); if (item.T_SYS_DICTIONARY2 != null) { dict.FATHERID = item.T_SYS_DICTIONARY2.DICTIONARYID; } LocalDictionaryInfos.Add(dict); } V_DictionaryInfoVM.SaveV_DictionaryInfo(bIsSaveAll, LocalDictionaryInfos); }