コード例 #1
0
 public AssessmentPhotosViewData(Person currentPerson, Models.TreatmentBMPAssessment treatmentBMPAssessment,
                                 Models.FieldVisitSection fieldVisitSection, ManagePhotosWithPreviewViewData managePhotosWithPreviewViewData)
     : base(currentPerson, treatmentBMPAssessment.FieldVisit, fieldVisitSection)
 {
     SubsectionName = "Photos";
     SectionHeader  = $"{SectionHeader} - {SubsectionName}";
     ManagePhotosWithPreviewViewData = managePhotosWithPreviewViewData;
 }
コード例 #2
0
        public FieldVisitSectionViewData(Person currentPerson, Models.FieldVisit fieldVisit, Models.FieldVisitSection fieldVisitSection)
            : base(currentPerson, NeptuneArea.OCStormwaterTools)
        {
            FieldVisit  = fieldVisit;
            SectionName = fieldVisitSection.FieldVisitSectionName;

            EntityName = "Treatment BMP Field Visits";
            EntityUrl  = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(x => x.Index());

            SubEntityName = fieldVisit.TreatmentBMP.TreatmentBMPName ?? "Preview Treatment BMP Field Visit";
            SubEntityUrl  = fieldVisit.TreatmentBMP?.GetDetailUrl() ?? "#";
            PageTitle     = fieldVisit.VisitDate.ToStringDate();

            EditDateAndTypeUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(x => x.EditDateAndType(fieldVisit.PrimaryKey));

            CanManageStormwaterJurisdiction = currentPerson.CanManageStormwaterJurisdiction(fieldVisit.TreatmentBMP.StormwaterJurisdictionID);
            VerifiedUnverifiedFieldVisitUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(x => x.VerifyFieldVisit(FieldVisit.PrimaryKey));

            SectionHeader      = fieldVisitSection.SectionHeader;
            ValidationWarnings = new List <string>();

            WrapupUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(x => x.VisitSummary(fieldVisit));


            MaintenanceRecord              = fieldVisit.MaintenanceRecord;
            InitialAssessment              = fieldVisit.GetAssessmentByType(TreatmentBMPAssessmentTypeEnum.Initial);
            PostMaintenanceAssessment      = fieldVisit.GetAssessmentByType(TreatmentBMPAssessmentTypeEnum.PostMaintenance);
            UserCanDeleteMaintenanceRecord = MaintenanceRecord != null &&
                                             new MaintenanceRecordManageFeature()
                                             .HasPermission(CurrentPerson, MaintenanceRecord)
                                             .HasPermission;
        }