Exemplo n.º 1
0
        public ActionResult EditCommonFolder(String virtualPath)
        {
            DocumentsOperations docOps = new DocumentsOperations();
            var file = docOps.GetFileByVirtualPath(virtualPath);
            CommonFolderAssignment cfa = new CommonFolderAssignment {
                FolderName  = file.Name,
                CreatedAt   = file.DateTimeUploaded.ToString(),
                VirtualPath = file.VirtualPath,
                UsersName   = docOps.GetUsersNameByFileID(file.ID),
                RolesName   = docOps.GetRolesNameByFileID(file.ID)
            };
            MembershipUserCollection allUsers      = Membership.GetAllUsers();
            List <String>            excludedUsers = new List <String>();

            foreach (MembershipUser user in allUsers)
            {
                if (!cfa.UsersName.Contains(user.UserName))
                {
                    excludedUsers.Add(user.UserName);
                }
            }
            cfa.ExcludedUsers = excludedUsers;
            cfa.ExcludedRoles = Roles.GetAllRoles().Except(cfa.RolesName).ToList();
            return(View(cfa));
        }
Exemplo n.º 2
0
        public ActionResult CommonFolderMgt()
        {
            CommonFolderManagement        cfm     = new CommonFolderManagement();
            List <CommonFolderAssignment> cfaList = new List <CommonFolderAssignment>();
            DocumentsOperations           docOps  = new DocumentsOperations();

            foreach (var item in docOps.GetFilesStartsWithVirtualPath(UtilityOperations.GetDockerCommonFolderPath()))
            {
                cfaList.Add(new CommonFolderAssignment {
                    FolderName  = item.Name,
                    CreatedAt   = item.DateTimeUploaded.ToString(),
                    VirtualPath = item.VirtualPath,
                    UsersName   = docOps.GetUsersNameByFileID(item.ID),
                    RolesName   = docOps.GetRolesNameByFileID(item.ID)
                });
            }
            cfm.CommonFolderAssignment = cfaList;
            return(View(cfm));
        }