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 List <RoadFlow.Data.Model.DocumentDirectory> DataReaderToList(SqlDataReader dataReader)
        {
            List <RoadFlow.Data.Model.DocumentDirectory> list = new List <RoadFlow.Data.Model.DocumentDirectory>();

            RoadFlow.Data.Model.DocumentDirectory documentDirectory = null;
            while (dataReader.Read())
            {
                documentDirectory          = new RoadFlow.Data.Model.DocumentDirectory();
                documentDirectory.ID       = dataReader.GetGuid(0);
                documentDirectory.ParentID = dataReader.GetGuid(1);
                documentDirectory.Name     = dataReader.GetString(2);
                if (!dataReader.IsDBNull(3))
                {
                    documentDirectory.ReadUsers = dataReader.GetString(3);
                }
                if (!dataReader.IsDBNull(4))
                {
                    documentDirectory.ManageUsers = dataReader.GetString(4);
                }
                if (!dataReader.IsDBNull(5))
                {
                    documentDirectory.PublishUsers = dataReader.GetString(5);
                }
                documentDirectory.Sort = dataReader.GetInt32(6);
                list.Add(documentDirectory);
            }
            return(list);
        }
Exemple #3
0
        public ActionResult DirAdd(FormCollection collection)
        {
            string str  = base.Request.QueryString["DirID"];
            string str2 = base.Request.QueryString["currentDirID"];

            RoadFlow.Platform.DocumentDirectory   documentDirectory  = new RoadFlow.Platform.DocumentDirectory();
            RoadFlow.Data.Model.DocumentDirectory documentDirectory2 = null;
            if (str2.IsGuid())
            {
                documentDirectory2 = documentDirectory.Get(str2.ToGuid());
            }
            if (collection != null)
            {
                string str3         = base.Request.Form["Name"];
                string readUsers    = base.Request.Form["ReadUsers"];
                string publishUsers = base.Request.Form["PublishUsers"];
                string manageUsers  = base.Request.Form["ManageUsers"];
                string str4         = base.Request.Form["Sort"];
                bool   flag         = false;
                string oldXML       = string.Empty;
                if (documentDirectory2 == null)
                {
                    flag = true;
                    documentDirectory2          = new RoadFlow.Data.Model.DocumentDirectory();
                    documentDirectory2.ID       = Guid.NewGuid();
                    documentDirectory2.ParentID = str.ToGuid();
                }
                else
                {
                    oldXML = documentDirectory2.Serialize();
                }
                documentDirectory2.ManageUsers  = manageUsers;
                documentDirectory2.Name         = str3.Trim1();
                documentDirectory2.PublishUsers = publishUsers;
                documentDirectory2.ReadUsers    = readUsers;
                documentDirectory2.Sort         = str4.ToInt();
                if (flag)
                {
                    documentDirectory.Add(documentDirectory2);
                    RoadFlow.Platform.Log.Add("添加了栏目", documentDirectory2.Serialize(), RoadFlow.Platform.Log.Types.文档中心);
                }
                else
                {
                    documentDirectory.Update(documentDirectory2);
                    RoadFlow.Platform.Log.Add("修改了栏目", documentDirectory2.Serialize(), RoadFlow.Platform.Log.Types.文档中心, oldXML, documentDirectory2.Serialize());
                }
                documentDirectory.ClearDirUsersCache(documentDirectory2.ID);
                documentDirectory.ClearCache();
                base.ViewBag.script = "parent.frames[0].reLoad('" + documentDirectory2.ParentID + "');alert('保存成功!');window.location='List" + base.Request.Url.Query + "';";
            }
            if (documentDirectory2 == null)
            {
                documentDirectory2          = new RoadFlow.Data.Model.DocumentDirectory();
                documentDirectory2.Sort     = documentDirectory.GetMaxSort(str.ToGuid());
                documentDirectory2.ParentID = str.ToGuid();
            }
            return(View(documentDirectory2));
        }
 public string GetName(Guid id)
 {
     RoadFlow.Data.Model.DocumentDirectory documentDirectory = Get(id);
     if (documentDirectory != null)
     {
         return(documentDirectory.Name);
     }
     return("");
 }
 private void addParent(List <RoadFlow.Data.Model.DocumentDirectory> list, Guid id)
 {
     if (!id.IsEmptyGuid())
     {
         RoadFlow.Data.Model.DocumentDirectory documentDirectory = Get(id);
         if (documentDirectory != null)
         {
             list.Add(documentDirectory);
             addParent(list, documentDirectory.ParentID);
         }
     }
 }
        public List <RoadFlow.Data.Model.DocumentDirectory> GetAllChilds(Guid id, bool isMe = true)
        {
            List <RoadFlow.Data.Model.DocumentDirectory> list = new List <RoadFlow.Data.Model.DocumentDirectory>();

            RoadFlow.Data.Model.DocumentDirectory documentDirectory = Get(id);
            if (documentDirectory != null)
            {
                if (isMe)
                {
                    list.Add(documentDirectory);
                }
                addChilds(list, id);
            }
            return(list);
        }
        public List <RoadFlow.Data.Model.DocumentDirectory> GetAllParents(Guid id, bool isMe = false)
        {
            List <RoadFlow.Data.Model.DocumentDirectory> list = new List <RoadFlow.Data.Model.DocumentDirectory>();

            RoadFlow.Data.Model.DocumentDirectory documentDirectory = Get(id);
            if (documentDirectory == null)
            {
                return(list);
            }
            if (isMe)
            {
                list.Add(documentDirectory);
            }
            addParent(list, documentDirectory.ParentID);
            return(list);
        }
        public int Update(RoadFlow.Data.Model.DocumentDirectory model)
        {
            string sql = "UPDATE DocumentDirectory SET \r\n\t\t\t\tParentID=@ParentID,Name=@Name,ReadUsers=@ReadUsers,ManageUsers=@ManageUsers,PublishUsers=@PublishUsers,Sort=@Sort\r\n\t\t\t\tWHERE ID=@ID";

            SqlParameter[] parameter = new SqlParameter[7]
            {
                new SqlParameter("@ParentID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ParentID
                },
                new SqlParameter("@Name", SqlDbType.NVarChar, 1000)
                {
                    Value = model.Name
                },
                (model.ReadUsers == null) ? new SqlParameter("@ReadUsers", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ReadUsers", SqlDbType.VarChar, -1)
                {
                    Value = model.ReadUsers
                },
                (model.ManageUsers == null) ? new SqlParameter("@ManageUsers", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ManageUsers", SqlDbType.VarChar, -1)
                {
                    Value = model.ManageUsers
                },
                (model.PublishUsers == null) ? new SqlParameter("@PublishUsers", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@PublishUsers", SqlDbType.VarChar, -1)
                {
                    Value = model.PublishUsers
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                },
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
        public int Add(RoadFlow.Data.Model.DocumentDirectory model)
        {
            string sql = "INSERT INTO DocumentDirectory\r\n\t\t\t\t(ID,ParentID,Name,ReadUsers,ManageUsers,PublishUsers,Sort) \r\n\t\t\t\tVALUES(@ID,@ParentID,@Name,@ReadUsers,@ManageUsers,@PublishUsers,@Sort)";

            SqlParameter[] parameter = new SqlParameter[7]
            {
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                },
                new SqlParameter("@ParentID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ParentID
                },
                new SqlParameter("@Name", SqlDbType.NVarChar, 1000)
                {
                    Value = model.Name
                },
                (model.ReadUsers == null) ? new SqlParameter("@ReadUsers", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ReadUsers", SqlDbType.VarChar, -1)
                {
                    Value = model.ReadUsers
                },
                (model.ManageUsers == null) ? new SqlParameter("@ManageUsers", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ManageUsers", SqlDbType.VarChar, -1)
                {
                    Value = model.ManageUsers
                },
                (model.PublishUsers == null) ? new SqlParameter("@PublishUsers", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@PublishUsers", SqlDbType.VarChar, -1)
                {
                    Value = model.PublishUsers
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
 public bool HasDisplay(RoadFlow.Data.Model.DocumentDirectory dir, Guid userID)
 {
     if (dir == null)
     {
         return(false);
     }
     if (HasManage(dir.ID, userID) || HasRead(dir.ID, userID) || HasPublish(dir.ID, userID))
     {
         return(true);
     }
     foreach (RoadFlow.Data.Model.DocumentDirectory allChild in GetAllChilds(dir.ID))
     {
         if (HasManage(allChild.ID, userID) || HasRead(allChild.ID, userID) || HasPublish(allChild.ID, userID))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #11
0
        public ActionResult DirDelete(FormCollection collection)
        {
            string text = base.Request.QueryString["DirID"];
            string str  = base.Request.QueryString["currentDirID"];

            RoadFlow.Platform.DocumentDirectory   documentDirectory  = new RoadFlow.Platform.DocumentDirectory();
            RoadFlow.Data.Model.DocumentDirectory documentDirectory2 = null;
            if (str.IsGuid())
            {
                documentDirectory2 = documentDirectory.Get(str.ToGuid());
            }
            if (documentDirectory2 == null)
            {
                base.ViewBag.script = "alert('栏目为空!');window.location='List" + base.Request.Url.Query + "';";
                return(View());
            }
            if (documentDirectory2.ParentID == Guid.Empty)
            {
                base.ViewBag.script = "alert('根栏目不能删除根栏目!');window.location=window.location;";
                return(View());
            }
            string allChildIdString = documentDirectory.GetAllChildIdString(documentDirectory2.ID);

            RoadFlow.Platform.Documents documents = new RoadFlow.Platform.Documents();
            string[] array = allChildIdString.Split(',');
            foreach (string str2 in array)
            {
                documentDirectory.Delete(str2.ToGuid());
                documents.DeleteByDirectoryID(str2.ToGuid());
                documentDirectory.ClearDirUsersCache(str2.ToGuid());
            }
            documentDirectory.ClearCache();
            RoadFlow.Platform.Log.Add("删除的文档栏目及其所有下级栏目", allChildIdString, RoadFlow.Platform.Log.Types.文档中心);
            base.ViewBag.script = "parent.frames[0].reLoad('" + documentDirectory2.ParentID + "');alert('删除成功!');window.location='List" + base.Request.Url.Query + "';";
            return(View());
        }
 public int Update(RoadFlow.Data.Model.DocumentDirectory model)
 {
     return(dataDocumentDirectory.Update(model));
 }
 public int Add(RoadFlow.Data.Model.DocumentDirectory model)
 {
     return(dataDocumentDirectory.Add(model));
 }
        public int Add(RoadFlow.Data.Model.DocumentDirectory model)
        {
            //IL_001a: Unknown result type (might be due to invalid IL or missing references)
            //IL_001f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0030: Expected O, but got Unknown
            //IL_0031: Expected O, but got Unknown
            //IL_003f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0044: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: Expected O, but got Unknown
            //IL_0056: Expected O, but got Unknown
            //IL_0063: Unknown result type (might be due to invalid IL or missing references)
            //IL_0068: Unknown result type (might be due to invalid IL or missing references)
            //IL_0074: Expected O, but got Unknown
            //IL_0075: Expected O, but got Unknown
            //IL_008a: Unknown result type (might be due to invalid IL or missing references)
            //IL_008f: Unknown result type (might be due to invalid IL or missing references)
            //IL_009b: Expected O, but got Unknown
            //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b8: Expected O, but got Unknown
            //IL_00b9: Expected O, but got Unknown
            //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
            //IL_00df: Expected O, but got Unknown
            //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fc: Expected O, but got Unknown
            //IL_00fd: Expected O, but got Unknown
            //IL_0112: Unknown result type (might be due to invalid IL or missing references)
            //IL_0117: Unknown result type (might be due to invalid IL or missing references)
            //IL_0123: Expected O, but got Unknown
            //IL_0130: Unknown result type (might be due to invalid IL or missing references)
            //IL_0135: Unknown result type (might be due to invalid IL or missing references)
            //IL_0140: Expected O, but got Unknown
            //IL_0141: Expected O, but got Unknown
            //IL_014b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0150: Unknown result type (might be due to invalid IL or missing references)
            //IL_0161: Expected O, but got Unknown
            //IL_0162: Expected O, but got Unknown
            string sql = "INSERT INTO documentdirectory\r\n\t\t\t\t(ID,ParentID,Name,ReadUsers,ManageUsers,PublishUsers,Sort) \r\n\t\t\t\tVALUES(@ID,@ParentID,@Name,@ReadUsers,@ManageUsers,@PublishUsers,@Sort)";

            MySqlParameter[] obj = new MySqlParameter[7];
            MySqlParameter   val = new MySqlParameter("@ID", 253, 36);

            ((DbParameter)val).Value = model.ID;
            obj[0] = val;
            MySqlParameter val2 = new MySqlParameter("@ParentID", 253, 36);

            ((DbParameter)val2).Value = model.ParentID;
            obj[1] = val2;
            MySqlParameter val3 = new MySqlParameter("@Name", 752, -1);

            ((DbParameter)val3).Value = model.Name;
            obj[2] = val3;
            _003F val4;

            if (model.ReadUsers != null)
            {
                val4 = new MySqlParameter("@ReadUsers", 751, -1);
                ((DbParameter)val4).Value = model.ReadUsers;
            }
            else
            {
                val4 = new MySqlParameter("@ReadUsers", 751, -1);
                ((DbParameter)val4).Value = DBNull.Value;
            }
            obj[3] = val4;
            _003F val5;

            if (model.ManageUsers != null)
            {
                val5 = new MySqlParameter("@ManageUsers", 751, -1);
                ((DbParameter)val5).Value = model.ManageUsers;
            }
            else
            {
                val5 = new MySqlParameter("@ManageUsers", 751, -1);
                ((DbParameter)val5).Value = DBNull.Value;
            }
            obj[4] = val5;
            _003F val6;

            if (model.PublishUsers != null)
            {
                val6 = new MySqlParameter("@PublishUsers", 751, -1);
                ((DbParameter)val6).Value = model.PublishUsers;
            }
            else
            {
                val6 = new MySqlParameter("@PublishUsers", 751, -1);
                ((DbParameter)val6).Value = DBNull.Value;
            }
            obj[5] = val6;
            MySqlParameter val7 = new MySqlParameter("@Sort", 3, 11);

            ((DbParameter)val7).Value = model.Sort;
            obj[6] = val7;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
        public int Update(RoadFlow.Data.Model.DocumentDirectory model)
        {
            //IL_001a: Unknown result type (might be due to invalid IL or missing references)
            //IL_001f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0030: Expected O, but got Unknown
            //IL_0031: Expected O, but got Unknown
            //IL_003e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0043: Unknown result type (might be due to invalid IL or missing references)
            //IL_004f: Expected O, but got Unknown
            //IL_0050: Expected O, but got Unknown
            //IL_0065: Unknown result type (might be due to invalid IL or missing references)
            //IL_006a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0076: Expected O, but got Unknown
            //IL_0083: Unknown result type (might be due to invalid IL or missing references)
            //IL_0088: Unknown result type (might be due to invalid IL or missing references)
            //IL_0093: Expected O, but got Unknown
            //IL_0094: Expected O, but got Unknown
            //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ba: Expected O, but got Unknown
            //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d7: Expected O, but got Unknown
            //IL_00d8: Expected O, but got Unknown
            //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fe: Expected O, but got Unknown
            //IL_010b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0110: Unknown result type (might be due to invalid IL or missing references)
            //IL_011b: Expected O, but got Unknown
            //IL_011c: Expected O, but got Unknown
            //IL_0126: Unknown result type (might be due to invalid IL or missing references)
            //IL_012b: Unknown result type (might be due to invalid IL or missing references)
            //IL_013c: Expected O, but got Unknown
            //IL_013d: Expected O, but got Unknown
            //IL_014b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0150: Unknown result type (might be due to invalid IL or missing references)
            //IL_0161: Expected O, but got Unknown
            //IL_0162: Expected O, but got Unknown
            string sql = "UPDATE documentdirectory SET \r\n\t\t\t\tParentID=@ParentID,Name=@Name,ReadUsers=@ReadUsers,ManageUsers=@ManageUsers,PublishUsers=@PublishUsers,Sort=@Sort\r\n\t\t\t\tWHERE ID=@ID";

            MySqlParameter[] obj = new MySqlParameter[7];
            MySqlParameter   val = new MySqlParameter("@ParentID", 253, 36);

            ((DbParameter)val).Value = model.ParentID;
            obj[0] = val;
            MySqlParameter val2 = new MySqlParameter("@Name", 752, -1);

            ((DbParameter)val2).Value = model.Name;
            obj[1] = val2;
            _003F val3;

            if (model.ReadUsers != null)
            {
                val3 = new MySqlParameter("@ReadUsers", 751, -1);
                ((DbParameter)val3).Value = model.ReadUsers;
            }
            else
            {
                val3 = new MySqlParameter("@ReadUsers", 751, -1);
                ((DbParameter)val3).Value = DBNull.Value;
            }
            obj[2] = val3;
            _003F val4;

            if (model.ManageUsers != null)
            {
                val4 = new MySqlParameter("@ManageUsers", 751, -1);
                ((DbParameter)val4).Value = model.ManageUsers;
            }
            else
            {
                val4 = new MySqlParameter("@ManageUsers", 751, -1);
                ((DbParameter)val4).Value = DBNull.Value;
            }
            obj[3] = val4;
            _003F val5;

            if (model.PublishUsers != null)
            {
                val5 = new MySqlParameter("@PublishUsers", 751, -1);
                ((DbParameter)val5).Value = model.PublishUsers;
            }
            else
            {
                val5 = new MySqlParameter("@PublishUsers", 751, -1);
                ((DbParameter)val5).Value = DBNull.Value;
            }
            obj[4] = val5;
            MySqlParameter val6 = new MySqlParameter("@Sort", 3, 11);

            ((DbParameter)val6).Value = model.Sort;
            obj[5] = val6;
            MySqlParameter val7 = new MySqlParameter("@ID", 253, 36);

            ((DbParameter)val7).Value = model.ID;
            obj[6] = val7;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }