public override IEnumerable <FieldVisitSubsectionData> GetSubsections(FieldVisit fieldVisit) { yield return(new FieldVisitSubsectionData { SubsectionName = "Edit Maintenance Record", SubsectionUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(x => x.EditMaintenanceRecord(fieldVisit)) }); }
public static HtmlString GetStatusAsWorkflowUrl(this FieldVisit fieldVisit) { var fieldVisitStatus = fieldVisit.FieldVisitStatus; return(fieldVisitStatus != FieldVisitStatus.InProgress ? new HtmlString(fieldVisitStatus.FieldVisitStatusDisplayName) : UrlTemplate.MakeHrefString(WorkflowUrlTemplate.ParameterReplace(fieldVisit.FieldVisitID), fieldVisitStatus.FieldVisitStatusDisplayName)); }
public override IEnumerable <FieldVisitSubsectionData> GetSubsections(FieldVisit fieldVisit) { return(new[] { new FieldVisitSubsectionData { SubsectionName = "Location", SubsectionUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(x => x.Location(fieldVisit)) }, new FieldVisitSubsectionData { SubsectionName = "Photos", SubsectionUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(x => x.Photos(fieldVisit)) }, new FieldVisitSubsectionData { SubsectionName = "Attributes", SubsectionUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(x => x.Attributes(fieldVisit)) } }); }
public abstract IEnumerable <FieldVisitSubsectionData> GetSubsections(FieldVisit fieldVisit);
public abstract string GetSectionUrl(FieldVisit fieldVisit);
public static IEnumerable <FieldVisitSubsectionData> GetAssessmentSubsections(FieldVisit fieldVisit, TreatmentBMPAssessmentTypeEnum treatmentBMPAssessmentTypeEnum) { var treatmentBMP = fieldVisit.TreatmentBMP; var treatmentBMPAssessment = fieldVisit.GetAssessmentByType(treatmentBMPAssessmentTypeEnum); var assessmentSubsections = new List <FieldVisitSubsectionData> { new FieldVisitSubsectionData { SubsectionName = "Observations", SubsectionUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(c => c.Observations(fieldVisit, treatmentBMPAssessmentTypeEnum)), SectionCompletionStatusIndicator = treatmentBMP.TreatmentBMPType.TreatmentBMPTypeAssessmentObservationTypes.All(x => treatmentBMPAssessment.IsObservationComplete(x.TreatmentBMPAssessmentObservationType)) ? new HtmlString("<span class='glyphicon glyphicon-ok field-validation-success text-left' style='color: #5cb85c; margin-right: 4px'></span>") : new HtmlString("<span class='glyphicon glyphicon-exclamation-sign field-validation-warning text-left' style='margin-right: 4px'></span>") }, new FieldVisitSubsectionData { SubsectionName = "Photos", SubsectionUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(c => c.AssessmentPhotos(fieldVisit, treatmentBMPAssessmentTypeEnum)), SectionCompletionStatusIndicator = treatmentBMPAssessment.TreatmentBMPAssessmentPhotos.Any() ? new HtmlString( "<span class='glyphicon glyphicon-ok field-validation-success text-left' style='color: #5cb85c; margin-right: 4px'></span>") : new HtmlString("<span style=\"width: 19px; display: inline-block;\"></span>") } }; return(assessmentSubsections); }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static MaintenanceRecord CreateNewBlank(TreatmentBMP treatmentBMP, TreatmentBMPType treatmentBMPType, FieldVisit fieldVisit) { return(new MaintenanceRecord(treatmentBMP, treatmentBMPType, fieldVisit)); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public TreatmentBMPAssessment(TreatmentBMP treatmentBMP, TreatmentBMPType treatmentBMPType, FieldVisit fieldVisit, TreatmentBMPAssessmentType treatmentBMPAssessmentType, bool isAssessmentComplete) : this() { // Mark this as a new object by setting primary key with special value this.TreatmentBMPAssessmentID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.TreatmentBMPID = treatmentBMP.TreatmentBMPID; this.TreatmentBMP = treatmentBMP; treatmentBMP.TreatmentBMPAssessments.Add(this); this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID; this.TreatmentBMPType = treatmentBMPType; treatmentBMPType.TreatmentBMPAssessments.Add(this); this.FieldVisitID = fieldVisit.FieldVisitID; this.FieldVisit = fieldVisit; fieldVisit.TreatmentBMPAssessments.Add(this); this.TreatmentBMPAssessmentTypeID = treatmentBMPAssessmentType.TreatmentBMPAssessmentTypeID; this.IsAssessmentComplete = isAssessmentComplete; }
public override IEnumerable <FieldVisitSubsectionData> GetSubsections(FieldVisit fieldVisit) { return(FieldVisitSectionImpl.GetAssessmentSubsections(fieldVisit, TreatmentBMPAssessmentTypeEnum.Initial)); }
public override bool ExpandMenu(FieldVisit fieldVisit) { return(fieldVisit.InventoryUpdated); }
public static void DeleteFieldVisit(this IQueryable <FieldVisit> fieldVisits, FieldVisit fieldVisitToDelete) { DeleteFieldVisit(fieldVisits, new List <FieldVisit> { fieldVisitToDelete }); }
public static string GetDetailUrl(this FieldVisit fieldVisit) { return(DetailUrlTemplate.ParameterReplace(fieldVisit.FieldVisitID)); }
public static string GetEditUrl(this FieldVisit fieldVisit) { return(WorkflowUrlTemplate.ParameterReplace(fieldVisit.FieldVisitID)); }
public static TreatmentBMPAssessment GetPostMaintenanceAssessment(this FieldVisit fieldVisit) { return(fieldVisit.TreatmentBMPAssessments.SingleOrDefault(x => x.TreatmentBMPAssessmentType == TreatmentBMPAssessmentType.PostMaintenance)); }
public static TreatmentBMPAssessment GetInitialAssessment(this FieldVisit fieldVisit) { return(fieldVisit.TreatmentBMPAssessments.SingleOrDefault(x => x.TreatmentBMPAssessmentType == TreatmentBMPAssessmentType.Initial)); }
public abstract bool ExpandMenu(FieldVisit fieldVisit);
public override bool ExpandMenu(FieldVisit fieldVisit) { return(fieldVisit.MaintenanceRecord != null); }
public override bool ExpandMenu(FieldVisit fieldVisit) { return(fieldVisit.GetPostMaintenanceAssessment() != null); }
public override string GetSectionUrl(FieldVisit fieldVisit) { return(SitkaRoute <FieldVisitController> .BuildUrlFromExpression(x => x.Assessment(fieldVisit))); }
public override IEnumerable <FieldVisitSubsectionData> GetSubsections(FieldVisit fieldVisit) { return(new List <FieldVisitSubsectionData>()); }
public override bool ExpandMenu(FieldVisit fieldVisit) { return(fieldVisit.GetInitialAssessment() != null); }
public override bool ExpandMenu(FieldVisit fieldVisit) { return(false); }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static TreatmentBMPAssessment CreateNewBlank(TreatmentBMP treatmentBMP, TreatmentBMPType treatmentBMPType, FieldVisit fieldVisit, TreatmentBMPAssessmentType treatmentBMPAssessmentType) { return(new TreatmentBMPAssessment(treatmentBMP, treatmentBMPType, fieldVisit, treatmentBMPAssessmentType, default(bool))); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public MaintenanceRecord(TreatmentBMP treatmentBMP, TreatmentBMPType treatmentBMPType, FieldVisit fieldVisit) : this() { // Mark this as a new object by setting primary key with special value this.MaintenanceRecordID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.TreatmentBMPID = treatmentBMP.TreatmentBMPID; this.TreatmentBMP = treatmentBMP; treatmentBMP.MaintenanceRecords.Add(this); this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID; this.TreatmentBMPType = treatmentBMPType; treatmentBMPType.MaintenanceRecords.Add(this); this.FieldVisitID = fieldVisit.FieldVisitID; this.FieldVisit = fieldVisit; }