public Guid GetExportCache(Guid programID, out string querySql, out List <IDbDataParameter> parList) { querySql = ""; parList = new List <IDbDataParameter>(); string str = ProgramBuilder.exportCackeKey + programID.ToString("N") + HttpContext.Current.Session.SessionID; object obj1 = Opation.Get(str + "_QuerySql"); if (obj1 != null) { querySql = obj1.ToString(); } object obj2 = Opation.Get(str + "_QueryParameter"); if (obj2 != null) { parList = (List <IDbDataParameter>)obj2; } object obj3 = Opation.Get(str + "_DbConnID"); if (obj3 != null) { return(obj3.ToString().ToGuid()); } return(Guid.Empty); }
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.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); }
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.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 = 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 string Delete() { object obj = base.Request.QueryString["str1"]; string text2 = base.Request.QueryString["str2"]; if (obj == null) { obj = ""; } Opation.Get((string)obj); if (!WebMvc.Common.Tools.CheckLogin(false)) { return("var json = {\"success\":0,\"message\":\"您不能删除文件\"}"); } string text = base.Request.QueryString["file"]; if (!text.IsNullOrEmpty()) { try { System.IO.File.Delete(base.Server.MapPath(Path.Combine(base.Url.Content("~/Content/Controls/UploadFiles/"), text))); return("var json = {\"success\":1,\"message\":\"\"}"); } catch (Exception ex) { return("var json = {\"success\":0,\"message\":\"" + ex.Message + "\"}"); } } 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>()); }
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.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 Delete() { string key = this.Request.QueryString["str1"]; string str1 = this.Request.QueryString["str2"]; if (key == null) { key = ""; } Opation.Get(key); if (!WebMvc.Common.Tools.CheckLogin(false)) { return("var json = {\"success\":0,\"message\":\"您不能删除文件\"}"); } string str2 = this.Request.QueryString["file"]; if (str2.IsNullOrEmpty()) { return(""); } try { File.Delete(this.Server.MapPath(Path.Combine(this.Url.Content("~/Content/Controls/UploadFiles/"), str2))); return("var json = {\"success\":1,\"message\":\"\"}"); } catch (Exception ex) { return("var json = {\"success\":0,\"message\":\"" + ex.Message + "\"}"); } }
private void set(List <RoadFlow.Data.Model.OnlineUsers> list) { if (list != null) { Opation.Set(key, list); } }
public ProgramBuilderCache GetSet(Guid id) { object obj = Opation.Get(15.ToString() + id.ToString("N")); if (obj != null) { return((ProgramBuilderCache)obj); } ProgramBuilderCache programBuilderCache = new ProgramBuilderCache(); RoadFlow.Data.Model.ProgramBuilder programBuilder = Get(id); if (programBuilder == null) { return(null); } programBuilderCache.Program = programBuilder; programBuilderCache.Fields = (from p in new ProgramBuilderFields().GetAll(id) orderby p.Sort select p).ToList(); programBuilderCache.Querys = (from p in new ProgramBuilderQuerys().GetAll(id) orderby p.Sort select p).ToList(); programBuilderCache.Buttons = (from p in new ProgramBuilderButtons().GetAll(id) orderby p.Sort select p).ToList(); programBuilderCache.Validates = new ProgramBuilderValidates().GetAll(id); programBuilderCache.Export = (from p in new ProgramBuilderExport().GetAll(id) orderby p.Sort select p).ToList(); AddToCache(programBuilderCache); return(programBuilderCache); }
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); }
private void set(List <RoadFlow.Data.Model.OnlineUsers> list) { if (list == null) { return; } Opation.Set(this.key, (object)list); }
public List <RoadFlow.Data.Model.OnlineUsers> GetAll() { object obj = Opation.Get(this.key); if (obj == null || !(obj is List <RoadFlow.Data.Model.OnlineUsers>)) { return(new List <RoadFlow.Data.Model.OnlineUsers>()); } return((List <RoadFlow.Data.Model.OnlineUsers>)obj); }
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.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.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.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 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 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.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.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.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); }
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); }
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); }