コード例 #1
0
ファイル: ProjectService.cs プロジェクト: WhiteIsland/epiworx
        public static Project ProjectInsert(Project project)
        {
            project = project.Save();

            FeedService.FeedAdd("Created", project);

            return project;
        }
コード例 #2
0
ファイル: ProjectService.cs プロジェクト: WhiteIsland/epiworx
        public static bool ProjectDelete(Project project)
        {
            Project.DeleteProject(
                new ProjectCriteria
                    {
                        ProjectId = project.ProjectId
                    });

            FeedService.FeedAdd("Deleted", project);

            return true;
        }
コード例 #3
0
ファイル: ProjectData.cs プロジェクト: mattruma/epiworx-csla
        public ProjectData(Project project)
            : this()
        {
            this.ProjectId = project.ProjectId;
            this.Description = project.Description;
            this.IsActive = project.IsActive;
            this.IsArchived = project.IsArchived;
            this.Name = project.Name;
            this.CreatedBy = new UserData(project.CreatedBy, string.Empty, string.Empty);
            this.CreatedDate = project.CreatedDate;
            this.ModifiedBy = new UserData(project.ModifiedBy, string.Empty, string.Empty);
            this.ModifiedDate = project.ModifiedDate;

            foreach (var brokenRule in project.BrokenRulesCollection)
            {
                this.BrokenRules.Add(new BrokenRuleData(brokenRule));
            }
        }
コード例 #4
0
ファイル: ProjectService.cs プロジェクト: WhiteIsland/epiworx
        public static Project ProjectSave(Project project)
        {
            if (!project.IsValid)
            {
                return project;
            }

            Project result;

            if (project.IsNew)
            {
                result = ProjectService.ProjectInsert(project);
            }
            else
            {
                result = ProjectService.ProjectUpdate(project);
            }

            return result;
        }
コード例 #5
0
        public ProjectFormModel MapToModel(Project project, ProjectFormModel model, bool ignoreBrokenRules)
        {
            Csla.Data.DataMapper.Map(project, model, true);

            model.Tab = "Project";
            model.IsNew = project.IsNew;
            model.IsValid = project.IsValid;

            if (!project.IsNew)
            {
                model.Tasks = TaskService.TaskFetchInfoList(project);
                model.Sprints = SprintService.SprintFetchInfoList(project);
                model.Statuses = DataHelper.GetStatusList();
                model.Categories = DataHelper.GetCategoryList();

                model.NoteListModel =
                   new NoteListModel
                   {
                       Source = project,
                       Notes = NoteService.NoteFetchInfoList(project).AsQueryable()
                   };

                model.AttachmentListModel =
                    new AttachmentListModel
                    {
                        Source = project,
                        Attachments = AttachmentService.AttachmentFetchInfoList(project).AsQueryable()
                    };
            }

            if (!ignoreBrokenRules)
            {
                foreach (var brokenRule in project.BrokenRulesCollection)
                {
                    this.ModelState.AddModelError(string.Empty, brokenRule.Description);
                }
            }

            return model;
        }
コード例 #6
0
ファイル: ProjectService.cs プロジェクト: WhiteIsland/epiworx
        public static Project ProjectUpdate(Project project)
        {
            project = project.Save();

            FeedService.FeedAdd("Updated", project);

            return project;
        }