public string GetFileContentType(string fileExtension) { if (fileExtension.IsNullOrEmpty()) { return(""); } string key = 22.ToString(); object obj = Opation.Get(key); List <Tuple <string, string> > list = new List <Tuple <string, string> >(); if (obj != null) { list = (List <Tuple <string, string> >)obj; } Tuple <string, string> tuple = list.Find((Tuple <string, string> p) => p.Item1.Equals(fileExtension, StringComparison.CurrentCultureIgnoreCase)); if (tuple != null) { return(tuple.Item2); } try { string text = Registry.GetValue("HKEY_CLASSES_ROOT\\" + fileExtension, "Content Type", string.Empty).ToString(); if (!text.IsNullOrEmpty()) { list.Add(new Tuple <string, string>(fileExtension, text)); Opation.Set(key, list); return(text); } } catch { } return(""); }
public List <RoadFlow.Data.Model.Users> GetPublishUsers(Guid dirID) { object obj = Opation.Get(this.DocumentsDirectoryPublishUsers + dirID.ToString("N")); if (obj is List <RoadFlow.Data.Model.Users> ) { return((List <RoadFlow.Data.Model.Users>)obj); } RoadFlow.Data.Model.DocumentDirectory documentDirectory = this.Get(dirID); if (documentDirectory == null) { return(new List <RoadFlow.Data.Model.Users>()); } if (!documentDirectory.PublishUsers.IsNullOrEmpty()) { List <RoadFlow.Data.Model.Users> allUsers = new Organize().GetAllUsers(documentDirectory.PublishUsers); Opation.Set(this.DocumentsDirectoryPublishUsers + dirID.ToString("N"), (object)allUsers); return(allUsers); } foreach (RoadFlow.Data.Model.DocumentDirectory allParent in this.GetAllParents(dirID, false)) { if (!allParent.PublishUsers.IsNullOrEmpty()) { List <RoadFlow.Data.Model.Users> allUsers = new Organize().GetAllUsers(allParent.PublishUsers); Opation.Set(this.DocumentsDirectoryPublishUsers + dirID.ToString("N"), (object)allUsers); return(allUsers); } } return(new List <RoadFlow.Data.Model.Users>()); }
public RoadFlow.Data.Model.Organize GetDeptByUserID(Guid userID) { string key = 13.ToString(); object obj = Opation.Get(key); Dictionary <Guid, RoadFlow.Data.Model.Organize> dictionary = new Dictionary <Guid, RoadFlow.Data.Model.Organize>(); if (obj is Dictionary <Guid, RoadFlow.Data.Model.Organize> ) { dictionary = (Dictionary <Guid, RoadFlow.Data.Model.Organize>)obj; if (dictionary.ContainsKey(userID)) { return(dictionary[userID]); } } Guid mainStation = GetMainStation(userID); if (mainStation == Guid.Empty) { return(null); } List <RoadFlow.Data.Model.Organize> allParent = new Organize().GetAllParent(mainStation); allParent.Reverse(); foreach (RoadFlow.Data.Model.Organize item in allParent) { if (item.Type == 2) { dictionary.Add(userID, item); Opation.Set(key, dictionary); return(item); } } return(null); }
public bool RemoveAll() { List <RoadFlow.Data.Model.OnlineUsers> obj = new List <RoadFlow.Data.Model.OnlineUsers>(); Opation.Set(key, obj); return(true); }
public List <RoadFlow.Data.Model.MenuUser> GetAll(bool cache = true) { if (!cache) { Organize organize = new Organize(); List <RoadFlow.Data.Model.MenuUser> all = this.dataMenuUser.GetAll(); foreach (RoadFlow.Data.Model.MenuUser menuUser in all) { menuUser.Users = organize.GetAllUsersIdString(menuUser.Organizes); } return(all); } object obj = Opation.Get(MenuUser.cachekey); if (obj != null) { return((List <RoadFlow.Data.Model.MenuUser>)obj); } Organize organize1 = new Organize(); List <RoadFlow.Data.Model.MenuUser> all1 = this.dataMenuUser.GetAll(); foreach (RoadFlow.Data.Model.MenuUser menuUser in all1) { menuUser.Users = organize1.GetAllUsersIdString(menuUser.Organizes); } Opation.Set(MenuUser.cachekey, (object)all1); return(all1); }
private void set(List <RoadFlow.Data.Model.OnlineUsers> list) { if (list != null) { Opation.Set(key, list); } }
public RoadFlow.Data.Model.Organize GetDeptByUserID(Guid userID) { string key = Keys.CacheKeys.UserDept.ToString(); object obj = Opation.Get(key); System.Collections.Generic.Dictionary <Guid, RoadFlow.Data.Model.Organize> dictionary = new System.Collections.Generic.Dictionary <Guid, RoadFlow.Data.Model.Organize>(); if (obj is System.Collections.Generic.Dictionary <Guid, RoadFlow.Data.Model.Organize> ) { dictionary = (System.Collections.Generic.Dictionary <Guid, RoadFlow.Data.Model.Organize>)obj; if (dictionary.ContainsKey(userID)) { return(dictionary[userID]); } } Guid mainStation = this.GetMainStation(userID); if (mainStation == Guid.Empty) { return((RoadFlow.Data.Model.Organize)null); } List <RoadFlow.Data.Model.Organize> allParent = new Organize().GetAllParent(mainStation); allParent.Reverse(); foreach (RoadFlow.Data.Model.Organize organize in allParent) { if (organize.Type == 2) { dictionary.Add(userID, organize); Opation.Set(key, (object)dictionary); return(organize); } } return((RoadFlow.Data.Model.Organize)null); }
public List <RoadFlow.Data.Model.MenuUser> GetAll(bool cache = true) { if (!cache) { Organize organize = new Organize(); List <RoadFlow.Data.Model.MenuUser> all = dataMenuUser.GetAll(); { foreach (RoadFlow.Data.Model.MenuUser item in all) { item.Users = organize.GetAllUsersIdString(item.Organizes); } return(all); } } object obj = Opation.Get(cachekey); if (obj == null) { Organize organize2 = new Organize(); List <RoadFlow.Data.Model.MenuUser> all2 = dataMenuUser.GetAll(); foreach (RoadFlow.Data.Model.MenuUser item2 in all2) { item2.Users = organize2.GetAllUsersIdString(item2.Organizes); } Opation.Set(cachekey, all2); return(all2); } return((List <RoadFlow.Data.Model.MenuUser>)obj); }
public string GetFileContentType(string fileExtension) { if (fileExtension.IsNullOrEmpty()) { return(""); } string key = Keys.CacheKeys.FileContentType.ToString(); object obj = Opation.Get(key); List <Tuple <string, string> > tupleList = new List <Tuple <string, string> >(); if (obj != null) { tupleList = (List <Tuple <string, string> >)obj; } Tuple <string, string> tuple = tupleList.Find((Predicate <Tuple <string, string> >)(p => p.Item1.Equals(fileExtension, StringComparison.CurrentCultureIgnoreCase))); if (tuple != null) { return(tuple.Item2); } try { string str = Registry.GetValue("HKEY_CLASSES_ROOT\\" + fileExtension, "Content Type", (object)string.Empty).ToString(); if (!str.IsNullOrEmpty()) { tupleList.Add(new Tuple <string, string>(fileExtension, str)); Opation.Set(key, (object)tupleList); return(str); } } catch { } return(""); }
public List <RoadFlow.Data.Model.Users> GetManageUsers(Guid dirID) { object obj = Opation.Get(DocumentsDirectoryManageUsers + dirID.ToString("N")); if (obj is List <RoadFlow.Data.Model.Users> ) { return((List <RoadFlow.Data.Model.Users>)obj); } RoadFlow.Data.Model.DocumentDirectory documentDirectory = Get(dirID); if (documentDirectory == null) { return(new List <RoadFlow.Data.Model.Users>()); } if (!documentDirectory.ManageUsers.IsNullOrEmpty()) { List <RoadFlow.Data.Model.Users> allUsers = new Organize().GetAllUsers(documentDirectory.ManageUsers); Opation.Set(DocumentsDirectoryManageUsers + dirID.ToString("N"), allUsers); return(allUsers); } foreach (RoadFlow.Data.Model.DocumentDirectory allParent in GetAllParents(dirID)) { if (!allParent.ManageUsers.IsNullOrEmpty()) { List <RoadFlow.Data.Model.Users> allUsers2 = new Organize().GetAllUsers(allParent.ManageUsers); Opation.Set(DocumentsDirectoryManageUsers + dirID.ToString("N"), allUsers2); return(allUsers2); } } return(new List <RoadFlow.Data.Model.Users>()); }
private void set(List <RoadFlow.Data.Model.OnlineUsers> list) { if (list == null) { return; } Opation.Set(this.key, (object)list); }
public void AddToExportCache(Guid programID, Guid dbConnID, string querySql, List <IDbDataParameter> parList) { string str = ProgramBuilder.exportCackeKey + programID.ToString("N") + HttpContext.Current.Session.SessionID; Opation.Set(str + "_DbConnID", (object)dbConnID); Opation.Set(str + "_QuerySql", (object)querySql); Opation.Set(str + "_QueryParameter", (object)parList); }
public List <RoadFlow.Data.Model.WorkFlowDelegation> GetNoExpiredListFromCache() { object obj = Opation.Get(cacheKey); if (obj != null && obj is List <RoadFlow.Data.Model.WorkFlowDelegation> ) { return((List <RoadFlow.Data.Model.WorkFlowDelegation>)obj); } List <RoadFlow.Data.Model.WorkFlowDelegation> noExpiredList = GetNoExpiredList(); Opation.Set(cacheKey, noExpiredList); return(noExpiredList); }
public List <RoadFlow.Data.Model.WorkTime> GetYearFromCache(int year) { string key = Keys.CacheKeys.WorkTime.ToString() + "_" + year.ToString(); object obj = Opation.Get(key); if (obj != null && obj is List <RoadFlow.Data.Model.WorkTime> ) { return((List <RoadFlow.Data.Model.WorkTime>)obj); } List <RoadFlow.Data.Model.WorkTime> all = this.GetAll(year); Opation.Set(key, (object)all); return(all); }
public List <RoadFlow.Data.Model.WorkFlowButtons> GetAll(bool fromCache = false) { if (fromCache) { string key = 4.ToString(); object obj = Opation.Get(key); if (obj != null && obj is List <RoadFlow.Data.Model.WorkFlowButtons> ) { return((List <RoadFlow.Data.Model.WorkFlowButtons>)obj); } List <RoadFlow.Data.Model.WorkFlowButtons> all = dataWorkFlowButtons.GetAll(); Opation.Set(key, all); return(all); } return(dataWorkFlowButtons.GetAll()); }
public List <RoadFlow.Data.Model.AppLibrarySubPages> GetAll(bool cache = true) { if (!cache) { return(dataAppLibrarySubPages.GetAll()); } object obj = Opation.Get(cachekey); if (obj == null || !(obj is List <RoadFlow.Data.Model.AppLibrarySubPages>)) { List <RoadFlow.Data.Model.AppLibrarySubPages> all = dataAppLibrarySubPages.GetAll(); Opation.Set(cachekey, all); return(all); } return((List <RoadFlow.Data.Model.AppLibrarySubPages>)obj); }
public List <RoadFlow.Data.Model.AppLibrary> GetAll(bool fromCache = false) { if (!fromCache) { return(dataAppLibrary.GetAll()); } object obj = Opation.Get(cacheKey); if (obj != null && obj is List <RoadFlow.Data.Model.AppLibrary> ) { return((List <RoadFlow.Data.Model.AppLibrary>)obj); } List <RoadFlow.Data.Model.AppLibrary> all = dataAppLibrary.GetAll(); Opation.Set(cacheKey, all); return(all); }
public List <RoadFlow.Data.Model.DocumentDirectory> GetAll(bool fromCache = true) { if (!fromCache) { return(dataDocumentDirectory.GetAll()); } object obj = Opation.Get(DocumentsDirectoryCacheKey); if (obj is List <RoadFlow.Data.Model.DocumentDirectory> ) { return((List <RoadFlow.Data.Model.DocumentDirectory>)obj); } List <RoadFlow.Data.Model.DocumentDirectory> all = dataDocumentDirectory.GetAll(); Opation.Set(DocumentsDirectoryCacheKey, all); return(all); }
public List <RoadFlow.Data.Model.AppLibraryButtons1> GetAll(bool cache = true) { if (!cache) { return(this.dataAppLibraryButtons1.GetAll()); } object obj = Opation.Get(AppLibraryButtons1.cachekey); if (obj != null && obj is List <RoadFlow.Data.Model.AppLibraryButtons1> ) { return((List <RoadFlow.Data.Model.AppLibraryButtons1>)obj); } List <RoadFlow.Data.Model.AppLibraryButtons1> all = this.dataAppLibraryButtons1.GetAll(); Opation.Set(AppLibraryButtons1.cachekey, (object)all); return(all); }
public List <RoadFlow.Data.Model.UserShortcut> GetAll(bool fromCache = false) { if (!fromCache) { return(this.dataUserShortcut.GetAll()); } object obj = Opation.Get(this.cacheKey); if (obj != null && obj is List <RoadFlow.Data.Model.UserShortcut> ) { return((List <RoadFlow.Data.Model.UserShortcut>)obj); } List <RoadFlow.Data.Model.UserShortcut> all = this.dataUserShortcut.GetAll(); Opation.Set(this.cacheKey, (object)all); return(all); }
public DataTable GetAllDataTable(bool cache = true) { if (!cache) { return(dataMenu.GetAllDataTable()); } string key = 0.ToString(); object obj = Opation.Get(key); if (obj == null || !(obj is DataTable)) { DataTable allDataTable = dataMenu.GetAllDataTable(); Opation.Set(key, allDataTable); return(allDataTable); } return((DataTable)obj); }
public List <RoadFlow.Data.Model.WorkFlowButtons> GetAll(bool fromCache = false) { if (!fromCache) { return(this.dataWorkFlowButtons.GetAll()); } string key = Keys.CacheKeys.WorkFlowButtons.ToString(); object obj = Opation.Get(key); if (obj != null && obj is List <RoadFlow.Data.Model.WorkFlowButtons> ) { return((List <RoadFlow.Data.Model.WorkFlowButtons>)obj); } List <RoadFlow.Data.Model.WorkFlowButtons> all = this.dataWorkFlowButtons.GetAll(); Opation.Set(key, (object)all); return(all); }
public List <RoadFlow.Data.Model.WorkCalendar> GetAll(int year, bool cache = true) { string key = "WorkCalendar_" + year.ToString(); if (!cache) { return(dataWorkCalendar.GetAll(year)); } object obj = Opation.Get(key); if (obj == null) { List <RoadFlow.Data.Model.WorkCalendar> all = dataWorkCalendar.GetAll(year); Opation.Set(key, all); return(all); } return((List <RoadFlow.Data.Model.WorkCalendar>)obj); }
private List <Tuple <Guid, string, int, int, List <Guid> > > GetAllList(bool fromCache = true) { string key = 8.ToString(); if (!fromCache) { return(getAllListByDb()); } object obj = Opation.Get(key); if (obj == null) { List <Tuple <Guid, string, int, int, List <Guid> > > allListByDb = getAllListByDb(); Opation.Set(key, allListByDb); return(allListByDb); } return((List <Tuple <Guid, string, int, int, List <Guid> > >)obj); }
private List <Tuple <Guid, string, int, int, List <Guid> > > GetAllList(bool fromCache = true) { string key = Keys.CacheKeys.WorkFlowComments.ToString(); if (!fromCache) { return(this.getAllListByDb()); } object obj = Opation.Get(key); if (obj != null) { return((List <Tuple <Guid, string, int, int, List <Guid> > >)obj); } List <Tuple <Guid, string, int, int, List <Guid> > > allListByDb = this.getAllListByDb(); Opation.Set(key, (object)allListByDb); return(allListByDb); }
public List <RoadFlow.Data.Model.Dictionary> GetAll(bool fromCache = false) { if (!fromCache) { return(dataDictionary.GetAll()); } List <RoadFlow.Data.Model.Dictionary> list = new List <RoadFlow.Data.Model.Dictionary>(); object obj = Opation.Get(cacheKey); if (obj != null && obj is List <RoadFlow.Data.Model.Dictionary> ) { list = (List <RoadFlow.Data.Model.Dictionary>)obj; } if (list.Count > 0) { return(list); } list = dataDictionary.GetAll(); Opation.Set(cacheKey, list); return(list); }
public List <RoadFlow.Data.Model.Dictionary> GetAll(bool fromCache = false) { if (!fromCache) { return(this.dataDictionary.GetAll()); } List <RoadFlow.Data.Model.Dictionary> dictionaryList = new List <RoadFlow.Data.Model.Dictionary>(); object obj = Opation.Get(Dictionary.cacheKey); if (obj != null && obj is List <RoadFlow.Data.Model.Dictionary> ) { dictionaryList = (List <RoadFlow.Data.Model.Dictionary>)obj; } if (dictionaryList.Count > 0) { return(dictionaryList); } List <RoadFlow.Data.Model.Dictionary> all = this.dataDictionary.GetAll(); Opation.Set(Dictionary.cacheKey, (object)all); return(all); }
public List <RoadFlow.Data.Model.HomeItems> GetAllByUserID(Guid userID) { object obj = Opation.Get(this.cacheKey); List <RoadFlow.Data.Model.HomeItems> homeItemsList1 = new List <RoadFlow.Data.Model.HomeItems>(); List <RoadFlow.Data.Model.HomeItems> homeItemsList2; if (obj != null && obj is List <RoadFlow.Data.Model.HomeItems> ) { homeItemsList2 = (List <RoadFlow.Data.Model.HomeItems>)obj; } else { Organize organize = new Organize(); homeItemsList2 = this.GetAll(); foreach (RoadFlow.Data.Model.HomeItems homeItems in homeItemsList2) { homeItems.UseUsers = organize.GetAllUsersIdString(homeItems.UseOrganizes); } Opation.Set(this.cacheKey, (object)homeItemsList2); } return(homeItemsList2.FindAll((Predicate <RoadFlow.Data.Model.HomeItems>)(p => p.UseUsers.Contains(userID.ToString(), StringComparison.CurrentCultureIgnoreCase))).OrderBy <RoadFlow.Data.Model.HomeItems, int>((Func <RoadFlow.Data.Model.HomeItems, int>)(p => p.Type)).ThenBy <RoadFlow.Data.Model.HomeItems, int?>((Func <RoadFlow.Data.Model.HomeItems, int?>)(p => p.Sort)).ToList <RoadFlow.Data.Model.HomeItems>()); }
public List <RoadFlow.Data.Model.HomeItems> GetAllByUserID(Guid userID) { object obj = Opation.Get(cacheKey); List <RoadFlow.Data.Model.HomeItems> list = new List <RoadFlow.Data.Model.HomeItems>(); if (obj != null && obj is List <RoadFlow.Data.Model.HomeItems> ) { list = (List <RoadFlow.Data.Model.HomeItems>)obj; } else { Organize organize = new Organize(); list = GetAll(); foreach (RoadFlow.Data.Model.HomeItems item in list) { item.UseUsers = organize.GetAllUsersIdString(item.UseOrganizes); } Opation.Set(cacheKey, list); } return((from p in list.FindAll((RoadFlow.Data.Model.HomeItems p) => p.UseUsers.Contains(userID.ToString(), StringComparison.CurrentCultureIgnoreCase)) orderby p.Type, p.Sort select p).ToList()); }
public void RefreshCache() { Opation.Set(Dictionary.cacheKey, (object)this.GetAll(false)); }