Exemple #1
0
        public ViewResult Edit(CustomAttributeTypePrimaryKey customAttributeTypePrimaryKey)
        {
            var customAttributeType = customAttributeTypePrimaryKey.EntityObject;
            var viewModel           = new EditViewModel(customAttributeType);

            return(ViewEdit(viewModel, customAttributeType));
        }
Exemple #2
0
        public PartialViewResult DeleteCustomAttributeType(CustomAttributeTypePrimaryKey customAttributeTypePrimaryKey)
        {
            var customAttributeType = customAttributeTypePrimaryKey.EntityObject;
            var viewModel           = new ConfirmDialogFormViewModel(customAttributeType.CustomAttributeTypeID);

            return(ViewDeleteCustomAttributeType(customAttributeType, viewModel));
        }
Exemple #3
0
        public ViewResult Detail(CustomAttributeTypePrimaryKey customAttributeTypePrimaryKey)
        {
            var customAttributeType = customAttributeTypePrimaryKey.EntityObject;
            var viewData            = new DetailViewData(CurrentPerson, customAttributeType);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Exemple #4
0
        public ActionResult Edit(CustomAttributeTypePrimaryKey customAttributeTypePrimaryKey, EditViewModel viewModel)
        {
            var customAttributeType = customAttributeTypePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEdit(viewModel, customAttributeType));
            }
            viewModel.UpdateModel(customAttributeType, CurrentPerson);

            return(RedirectToAction(new SitkaRoute <CustomAttributeTypeController>(c => c.Detail(customAttributeType.PrimaryKey))));
        }
Exemple #5
0
        public ActionResult DeleteCustomAttributeType(CustomAttributeTypePrimaryKey customAttributeTypePrimaryKey, ConfirmDialogFormViewModel viewModel)
        {
            var customAttributeType = customAttributeTypePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteCustomAttributeType(customAttributeType, viewModel));
            }

            var message = $"{FieldDefinitionType.CustomAttributeType.GetFieldDefinitionLabel()} '{customAttributeType.CustomAttributeTypeName}' successfully deleted!";

            customAttributeType.DeleteFull(HttpRequestStorage.DatabaseEntities);
            SetMessageForDisplay(message);
            return(new ModalDialogFormJsonResult());
        }
Exemple #6
0
        public GridJsonNetJObjectResult <TreatmentBMPType> TreatmentBMPTypeGridJsonData(CustomAttributeTypePrimaryKey customAttributeTypePrimaryKey)
        {
            var gridSpec                 = new TreatmentBMPTypeGridSpec(CurrentPerson);
            var customAttributeType      = customAttributeTypePrimaryKey.EntityObject;
            var treatmentBMPTypes        = customAttributeType.TreatmentBMPTypeCustomAttributeTypes.Select(x => x.TreatmentBMPType).OrderBy(x => x.TreatmentBMPTypeName).ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <TreatmentBMPType>(treatmentBMPTypes, gridSpec);

            return(gridJsonNetJObjectResult);
        }