Exemple #1
0
        private DMSLogicModel GetDMSAndCheckPermission(string projectGuid, PermissionType permissionType)
        {
            // CheckPermission(PermissionObjectType.Project, projectGuid, permissionType);
            var projectLogicModel = Platform.GetProject(projectGuid);
            int projectId         = m_dbAdapter.Project.GetProjectByGuid(projectGuid).ProjectId;
            var dmsJoinLogicModel = new DMSLogicModel(CurrentUserName, projectLogicModel, DMSType.DurationManagementPlatform, projectId.ToString());

            return(dmsJoinLogicModel);
        }
        private DMSLogicModel GetDMSAndCheckPermission(string shortCode, PermissionType permissionType)
        {
            var task = m_dbAdapter.Task.GetTask(shortCode);

            CheckPermission(PermissionObjectType.Task, shortCode, permissionType);

            var projectLogicModel = Platform.GetProject(task.ProjectId);

            var dmsJoinLogicModel = new DMSLogicModel(CurrentUserName, projectLogicModel, DMSType.Task, shortCode);

            return(dmsJoinLogicModel);
        }
Exemple #3
0
        private Tuple <List <string>, Dictionary <string, string> > GetCompressFilesPath(DMSLogicModel dmsLogicModel,
                                                                                         List <string> folderGuids, string currFolderName, Tuple <List <string>, Dictionary <string, string> > folderAndFilePath)
        {
            foreach (var folderGuid in folderGuids)
            {
                var parentFilePath = currFolderName;
                var folder         = dmsLogicModel.FindFolder(folderGuid);
                CommUtils.AssertNotNull(folder, "找不到文件夹[folderGuid={0}][DMS={1}],请刷新后再试",
                                        folderGuid, dmsLogicModel.Instance.Guid);

                var files = folder.Files;

                parentFilePath += folder.Instance.Name + FileUtils.PathSeparator;
                files.ForEach(x => folderAndFilePath.Item2[x.LatestVerFile.Guid] = parentFilePath + x.LatestVerFile.Name);
                if (files.Count == 0)
                {
                    folderAndFilePath.Item1.Add(parentFilePath);
                }
                var subFolders = folder.SubFolders;
                if (subFolders.Count > 0)
                {
                    var subFolderGuids = subFolders.ConvertAll(x => x.Instance.Guid);
                    subFolders.ForEach(x => GetCompressFilesPath(dmsLogicModel, subFolderGuids, parentFilePath, folderAndFilePath));
                }
            }
            return(folderAndFilePath);
        }