Пример #1
0
        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);
        }
Пример #2
0
        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("");
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        public bool RemoveAll()
        {
            List <RoadFlow.Data.Model.OnlineUsers> obj = new List <RoadFlow.Data.Model.OnlineUsers>();

            Opation.Set(key, obj);
            return(true);
        }
Пример #6
0
        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>());
        }
Пример #7
0
        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);
        }
Пример #8
0
        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("");
        }
Пример #9
0
        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>());
        }
Пример #10
0
        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("");
        }
Пример #11
0
        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);
        }
Пример #12
0
        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 + "\"}");
            }
        }
Пример #13
0
 private void set(List <RoadFlow.Data.Model.OnlineUsers> list)
 {
     if (list != null)
     {
         Opation.Set(key, list);
     }
 }
Пример #14
0
        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);
        }
Пример #15
0
        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);
        }
Пример #16
0
 private void set(List <RoadFlow.Data.Model.OnlineUsers> list)
 {
     if (list == null)
     {
         return;
     }
     Opation.Set(this.key, (object)list);
 }
Пример #17
0
        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);
        }
Пример #18
0
        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);
        }
Пример #19
0
        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);
        }
Пример #20
0
        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);
        }
Пример #21
0
 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());
 }
Пример #22
0
        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);
        }
Пример #23
0
        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);
        }
Пример #24
0
        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);
        }
Пример #25
0
        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);
        }
Пример #26
0
        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);
        }
Пример #27
0
        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);
        }
Пример #28
0
        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);
        }
Пример #29
0
        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);
        }
Пример #30
0
        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);
        }