예제 #1
0
 public EditProjectProjectStatusViewModel(ProjectFirmaModels.Models.ProjectProjectStatus projectProjectStatus)
 {
     ProjectProjectStatusComment = projectProjectStatus.ProjectProjectStatusComment;
     LessonsLearned = projectProjectStatus.LessonsLearned;
     ProjectStatusID = projectProjectStatus.ProjectStatusID;
     ProjectStatusUpdateDate = projectProjectStatus.ProjectProjectStatusUpdateDate;
     IsFinalStatusUpdate = projectProjectStatus.IsFinalStatusUpdate;
 }
 public EditProjectProjectStatusViewModel(ProjectFirmaModels.Models.ProjectProjectStatus projectProjectStatus)
 {
     ProjectProjectStatusRecentActivities   = projectProjectStatus.ProjectProjectStatusRecentActivities;
     ProjectProjectStatusUpcomingActivities = projectProjectStatus.ProjectProjectStatusUpcomingActivities;
     ProjectProjectStatusRisksOrIssues      = projectProjectStatus.ProjectProjectStatusRisksOrIssues;
     ProjectProjectStatusComment            = projectProjectStatus.ProjectProjectStatusComment;
     LessonsLearned          = projectProjectStatus.LessonsLearned;
     ProjectStatusID         = projectProjectStatus.ProjectStatusID;
     ProjectStatusUpdateDate = projectProjectStatus.ProjectProjectStatusUpdateDate;
     IsFinalStatusUpdate     = projectProjectStatus.IsFinalStatusUpdate;
 }
        public void UpdateModel(ProjectFirmaModels.Models.ProjectProjectStatus projectProjectStatus, FirmaSession currentFirmaSession)
        {
            projectProjectStatus.ProjectProjectStatusRecentActivities   = ProjectProjectStatusRecentActivities;
            projectProjectStatus.ProjectProjectStatusUpcomingActivities = ProjectProjectStatusUpcomingActivities;
            projectProjectStatus.ProjectProjectStatusRisksOrIssues      = ProjectProjectStatusRisksOrIssues;
            projectProjectStatus.ProjectProjectStatusComment            = ProjectProjectStatusComment;
            if (IsFinalStatusUpdate)
            {
                projectProjectStatus.LessonsLearned = LessonsLearned;
            }
            else
            {
                projectProjectStatus.LessonsLearned = null;
            }
            projectProjectStatus.ProjectStatusID = ProjectStatusID;

            if (ProjectStatusUpdateTime.HasValue && ProjectStatusUpdateDate.HasValue)
            {
                var year    = ProjectStatusUpdateDate.Value.Year;
                var month   = ProjectStatusUpdateDate.Value.Month;
                var day     = ProjectStatusUpdateDate.Value.Day;
                var hours   = ProjectStatusUpdateTime.Value.Hour;
                var minutes = ProjectStatusUpdateTime.Value.Minute;
                var seconds = 0;
                projectProjectStatus.ProjectProjectStatusUpdateDate = new DateTime(year, month, day, hours, minutes, seconds);
            }
            else
            {
                projectProjectStatus.ProjectProjectStatusUpdateDate = ProjectStatusUpdateDate.Value;
            }

            projectProjectStatus.IsFinalStatusUpdate = IsFinalStatusUpdate;
            if (!ModelObjectHelpers.IsRealPrimaryKeyValue(projectProjectStatus.PrimaryKey))
            {
                projectProjectStatus.ProjectProjectStatusCreateDate   = DateTime.Now;
                projectProjectStatus.ProjectProjectStatusCreatePerson = currentFirmaSession.Person;
            }
            else
            {
                projectProjectStatus.ProjectProjectStatusLastEditedDate   = DateTime.Now;
                projectProjectStatus.ProjectProjectStatusLastEditedPerson = currentFirmaSession.Person;
            }
        }