public static void SaveV_DictionaryInfo(bool bIsAll, List <V_DictionaryInfo> ents) { V_DictionaryInfo newV_DictionaryInfo = new V_DictionaryInfo(); var tmps = (from o in SterlingService.Current.Database.Query <V_DictionaryInfo, string>() select o.LazyValue.Value).ToList(); if (tmps != null) { if (tmps.Count() > 0) { if (bIsAll) { DeleteAllV_DictionaryInfo(); } else { foreach (var ent in ents) { DeleteSelectedV_DictionaryInfo(ent.DICTIONARYID); } } } } foreach (var o in ents) { SterlingService.Current.Database.Save(o); } SterlingService.Current.Database.Flush(); }
public static void SaveV_DictionaryInfo(bool bIsAll, List<V_DictionaryInfo> ents) { V_DictionaryInfo newV_DictionaryInfo = new V_DictionaryInfo(); var tmps = (from o in SterlingService.Current.Database.Query<V_DictionaryInfo, string>() select o.LazyValue.Value).ToList(); if (tmps != null) { if (tmps.Count() > 0) { if (bIsAll) { DeleteAllV_DictionaryInfo(); } else { foreach (var ent in ents) { DeleteSelectedV_DictionaryInfo(ent.DICTIONARYID); } } } } foreach (var o in ents) { SterlingService.Current.Database.Save(o); } SterlingService.Current.Database.Flush(); }
public static void DeleteSelectedV_DictionaryInfo(string strDictionaryID) { V_DictionaryInfo deleteV_DictionaryInfo = (from o in SterlingService.Current.Database.Query <V_DictionaryInfo, string>() where o.LazyValue.Value.DICTIONARYID == strDictionaryID select o.LazyValue.Value).FirstOrDefault(); if (deleteV_DictionaryInfo != null) { SterlingService.Current.Database.Delete(deleteV_DictionaryInfo); SterlingService.Current.Database.Flush(); } }
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); }