public static Project ProjectInsert(Project project) { project = project.Save(); FeedService.FeedAdd("Created", project); return project; }
public static bool ProjectDelete(Project project) { Project.DeleteProject( new ProjectCriteria { ProjectId = project.ProjectId }); FeedService.FeedAdd("Deleted", project); return true; }
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)); } }
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; }
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; }
public static Project ProjectUpdate(Project project) { project = project.Save(); FeedService.FeedAdd("Updated", project); return project; }