예제 #1
0
        public EditViewData(Person currentPerson,
                            IEnumerable <MeasurementUnitType> measurementUnitTypes,
                            List <ProjectCustomAttributeDataType> projectCustomAttributeDataTypes,
                            string submitUrl,
                            Models.FirmaPage instructionsFirmaPage,
                            Models.ProjectCustomAttributeType projectCustomAttributeType)
            : base(currentPerson)
        {
            EntityName = "Attribute Type";
            PageTitle  =
                $"{(projectCustomAttributeType != null ? "Edit" : "New")} Attribute Type";
            YesNos = BooleanFormats.GetYesNoSelectList();
            ProjectCustomAttributeDataTypes = projectCustomAttributeDataTypes.ToSelectListWithEmptyFirstRow(
                x => x.ProjectCustomAttributeDataTypeID.ToString(), x => x.ProjectCustomAttributeDataTypeDisplayName);
            MeasurementUnitTypes = measurementUnitTypes.OrderBy(x => x.MeasurementUnitTypeDisplayName)
                                   .ToSelectListWithEmptyFirstRow(
                x => x.MeasurementUnitTypeID.ToString(), x => x.MeasurementUnitTypeDisplayName,
                ViewUtilities.NoneString);
            ProjectCustomAttributeTypeIndexUrl =
                SitkaRoute <ProjectCustomAttributeTypeController> .BuildUrlFromExpression(x => x.Manage());

            SubmitUrl = submitUrl;

            ViewInstructionsFirmaPage = new ViewPageContentViewData(instructionsFirmaPage, currentPerson);

            ViewDataForAngular = new EditViewDataForAngular(projectCustomAttributeDataTypes);
        }
예제 #2
0
        public EditViewData(Person currentPerson, List <MeasurementUnitType> measurementUnitTypes,
                            List <CustomAttributeDataType> customAttributeDataTypes, string submitUrl,
                            Models.NeptunePage instructionsNeptunePage, Models.NeptunePage customAttributeInstructionsNeptunePage,
                            Models.CustomAttributeType customAttributeType) : base(currentPerson, NeptuneArea.OCStormwaterTools)
        {
            EntityName = "Attribute Type";
            EntityUrl  = SitkaRoute <CustomAttributeTypeController> .BuildUrlFromExpression(x => x.Manage());

            PageTitle =
                $"{(customAttributeType != null ? "Edit" : "New")} Attribute Type";

            if (customAttributeType != null)
            {
                SubEntityName = customAttributeType.CustomAttributeTypeName;
                SubEntityUrl  = customAttributeType.GetDetailUrl();
            }

            YesNos = BooleanFormats.GetYesNoSelectList();
            CustomAttributeDataTypes = customAttributeDataTypes.ToSelectListWithDisabledEmptyFirstRow(
                x => x.CustomAttributeDataTypeID.ToString(), x => x.CustomAttributeDataTypeDisplayName);
            MeasurementUnitTypes = measurementUnitTypes.OrderBy(x => x.MeasurementUnitTypeDisplayName).ToSelectListWithEmptyFirstRow(
                x => x.MeasurementUnitTypeID.ToString(), x => x.MeasurementUnitTypeDisplayName, ViewUtilities.NoneString);
            CustomAttributeTypePurposes =
                CustomAttributeTypePurpose.All.ToSelectListWithDisabledEmptyFirstRow(
                    x => x.CustomAttributeTypePurposeID.ToString(CultureInfo.InvariantCulture),
                    x => x.CustomAttributeTypePurposeDisplayName);

            CustomAttributeTypeIndexUrl =
                SitkaRoute <CustomAttributeTypeController> .BuildUrlFromExpression(x => x.Manage());

            SubmitUrl = submitUrl;

            ViewInstructionsNeptunePage = new ViewPageContentViewData(instructionsNeptunePage, currentPerson);
            ViewCustomAttributeInstructionsNeptunePage =
                new ViewPageContentViewData(customAttributeInstructionsNeptunePage, currentPerson);

            ViewDataForAngular = new ViewDataForAngular(customAttributeDataTypes);
        }