Exemplo n.º 1
0
        public ProjectTimelineUpdateEvent(ProjectUpdateBatch projectUpdateBatch)
        {
            var approvedProjectUpdateHistory = projectUpdateBatch.ProjectUpdateHistories.First(x => x.ProjectUpdateState == ProjectUpdateState.Approved);

            Date        = approvedProjectUpdateHistory.TransitionDate;
            DateDisplay = Date.ToString("MMM dd, yyyy");
            FiscalYear  = FirmaDateUtilities.CalculateFiscalYearForTenant(Date);
            Quarter     = (Quarter)FirmaDateUtilities.CalculateQuarterForTenant(Date);
            ProjectTimelineEventType       = ProjectTimelineEventType.Update;
            TimelineEventTypeDisplayName   = "Update";
            TimelineEventPersonDisplayName = approvedProjectUpdateHistory.UpdatePerson.GetPersonDisplayNameWithContactTypesListForProject(projectUpdateBatch.Project);
            ProjectTimelineSide            = ProjectTimelineSide.Left;
            EditButton   = new HtmlString(string.Empty);
            DeleteButton = new HtmlString(string.Empty);
            ShowDetailsLinkHtmlString = ProjectTimeline.MakeProjectUpdateDetailsLinkButton(projectUpdateBatch);
        }
Exemplo n.º 2
0
        public ProjectTimelineProjectStatusChangeEvent(ProjectProjectStatus projectProjectStatus, bool canEditProjectProjectStatus, bool canEditFinalStatusReport)
        {
            Date        = projectProjectStatus.ProjectProjectStatusUpdateDate;
            DateDisplay = Date.ToString("MMM dd, yyyy");
            FiscalYear  = FirmaDateUtilities.CalculateFiscalYearForTenant(Date);
            Quarter     = (Quarter)FirmaDateUtilities.CalculateQuarterForTenant(Date);
            ProjectTimelineEventType       = ProjectTimelineEventType.ProjectStatusChange;
            TimelineEventTypeDisplayName   = projectProjectStatus.IsFinalStatusUpdate ? "Final Status Update" : "Status Updated";
            TimelineEventPersonDisplayName = projectProjectStatus.ProjectProjectStatusCreatePerson.GetPersonDisplayNameWithContactTypesListForProject(projectProjectStatus.Project);
            ProjectTimelineSide            = ProjectTimelineSide.Right;

            EditButton   = ProjectTimeline.MakeProjectStatusEditLinkButton(projectProjectStatus, canEditProjectProjectStatus, canEditFinalStatusReport);
            DeleteButton = ProjectTimeline.MakeProjectStatusDeleteLinkButton(projectProjectStatus, canEditProjectProjectStatus, canEditFinalStatusReport);
            Color        = projectProjectStatus.ProjectStatus.ProjectStatusColor;
            ShowDetailsLinkHtmlString = ProjectTimeline.MakeProjectStatusDetailsLinkButton(projectProjectStatus);
            ProjectProjectStatus      = projectProjectStatus;
        }
Exemplo n.º 3
0
 public ProjectTimelineApprovalEvent(Project project)
 {
     if (project.ApprovalDate == null)
     {
         throw new SitkaProjectTimelineException("Cannot create a timeline approval event with a project that does not have an approval date.");
     }
     Date        = (DateTime)project.ApprovalDate;
     DateDisplay = Date.ToString("MMM dd, yyyy");
     FiscalYear  = FirmaDateUtilities.CalculateFiscalYearForTenant(Date);
     Quarter     = (Quarter)FirmaDateUtilities.CalculateQuarterForTenant(Date);
     ProjectTimelineEventType       = ProjectTimelineEventType.Approve;
     TimelineEventTypeDisplayName   = "Approved";
     TimelineEventPersonDisplayName = project.ReviewedByPerson?.GetPersonDisplayNameWithContactTypesListForProject(project);
     ProjectTimelineSide            = ProjectTimelineSide.Left;
     EditButton   = new HtmlString(string.Empty);
     DeleteButton = new HtmlString(string.Empty);
     ShowDetailsLinkHtmlString = new HtmlString(string.Empty);
 }
Exemplo n.º 4
0
 public ProjectTimelineProjectStatusChangeEvent(ProjectProjectStatus projectProjectStatus, bool canEditProjectProjectStatus, bool canEditFinalStatusReport)
 {
     Date        = projectProjectStatus.ProjectProjectStatusUpdateDate;
     DateDisplay = Date.ToString("MMM dd, yyyy");
     FiscalYear  = FirmaDateUtilities.CalculateFiscalYearForTenant(Date);
     Quarter     = (Quarter)FirmaDateUtilities.CalculateQuarterForTenant(Date);
     ProjectTimelineEventType       = ProjectTimelineEventType.ProjectStatusChange;
     TimelineEventTypeDisplayName   = projectProjectStatus.IsFinalStatusUpdate ? "Final Status Update" : "Status Updated";
     TimelineEventPersonDisplayName = projectProjectStatus.ProjectProjectStatusCreatePerson.GetPersonDisplayNameWithContactTypesListForProject(projectProjectStatus.Project);
     ProjectTimelineSide            = ProjectTimelineSide.Right;
     EditButton   = ProjectTimeline.MakeProjectStatusEditLinkButton(projectProjectStatus, canEditProjectProjectStatus, canEditFinalStatusReport);
     DeleteButton = ProjectTimeline.MakeProjectStatusDeleteLinkButton(projectProjectStatus, canEditProjectProjectStatus, canEditFinalStatusReport);
     Color        = projectProjectStatus.ProjectStatus.ProjectStatusColor;
     ShowDetailsLinkHtmlString = ProjectTimeline.MakeProjectStatusDetailsLinkButton(projectProjectStatus);
     ProjectProjectStatus      = projectProjectStatus;
     ActionItems = projectProjectStatus.ActionItems.ToList();
     AddActionItemLinkHtmlString = ModalDialogFormHelper.ModalDialogFormLink(string.Format("<span class='glyphicon glyphicon-plus' style='margin-right: 3px'></span>Add {0}", FieldDefinitionEnum.ActionItem.ToType().GetFieldDefinitionLabel()), SitkaRoute <ActionItemController> .BuildUrlFromExpression(c => c.NewForProjectStatus(projectProjectStatus.Project, projectProjectStatus)), string.Format("Add New {0}", FieldDefinitionEnum.ActionItem.ToType().GetFieldDefinitionLabel()), 700, "Add", "Cancel", new List <string> {
     }, null, null);
 }
Exemplo n.º 5
0
 public ProjectTimelineCreateEvent(Project project)
 {
     if (project.SubmissionDate == null)
     {
         throw new SitkaProjectTimelineException("Cannot create a timeline create event with a project that does not have a submission date.");
     }
     Date        = (DateTime)project.SubmissionDate;
     DateDisplay = Date.ToString("MMM dd, yyyy");
     FiscalYear  = FirmaDateUtilities.CalculateFiscalYearForTenant(Date);
     Quarter     = (Quarter)FirmaDateUtilities.CalculateQuarterForTenant(Date);
     ProjectTimelineEventType       = ProjectTimelineEventType.Create;
     TimelineEventTypeDisplayName   = "Created";
     TimelineEventPersonDisplayName = project.ProposingPerson.GetPersonDisplayNameWithContactTypesListForProject(project);
     ProjectTimelineSide            = ProjectTimelineSide.Left;
     EditButton   = new HtmlString(string.Empty);
     DeleteButton = new HtmlString(string.Empty);
     ShowDetailsLinkHtmlString = new HtmlString(string.Empty);
     ActionItems = new List <ActionItem>();
     AddActionItemLinkHtmlString = new HtmlString("");
 }