Exemplo n.º 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);
        }
Exemplo n.º 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("");
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
        public bool RemoveAll()
        {
            List <RoadFlow.Data.Model.OnlineUsers> obj = new List <RoadFlow.Data.Model.OnlineUsers>();

            Opation.Set(key, obj);
            return(true);
        }
Exemplo n.º 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>());
        }
Exemplo n.º 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);
        }
Exemplo n.º 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("");
        }
Exemplo n.º 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>());
        }
Exemplo n.º 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("");
        }
Exemplo n.º 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);
        }
Exemplo n.º 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 + "\"}");
            }
        }
Exemplo n.º 13
0
 private void set(List <RoadFlow.Data.Model.OnlineUsers> list)
 {
     if (list != null)
     {
         Opation.Set(key, list);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 16
0
 private void set(List <RoadFlow.Data.Model.OnlineUsers> list)
 {
     if (list == null)
     {
         return;
     }
     Opation.Set(this.key, (object)list);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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());
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }