Esempio n. 1
0
        public PartialViewResult DeleteProjectCustomAttributeType(ProjectCustomAttributeTypePrimaryKey projectCustomAttributeTypePrimaryKey)
        {
            var projectCustomAttributeType = projectCustomAttributeTypePrimaryKey.EntityObject;
            var viewModel = new ConfirmDialogFormViewModel(projectCustomAttributeType.ProjectCustomAttributeTypeID);

            return(ViewDeleteProjectCustomAttributeType(projectCustomAttributeType, viewModel));
        }
Esempio n. 2
0
        public ViewResult Detail(ProjectCustomAttributeTypePrimaryKey projectCustomAttributeTypePrimaryKey)
        {
            var projectCustomAttributeType = projectCustomAttributeTypePrimaryKey.EntityObject;
            var viewData = new DetailViewData(CurrentPerson, projectCustomAttributeType);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
        public PartialViewResult Edit(ProjectCustomAttributeTypePrimaryKey projectCustomAttributeTypePrimaryKey)
        {
            var projectCustomAttributeType = projectCustomAttributeTypePrimaryKey.EntityObject;
            var viewModel = new EditViewModel(projectCustomAttributeType);

            return(ViewEdit(viewModel, projectCustomAttributeType));
        }
Esempio n. 4
0
        public ActionResult Edit(ProjectCustomAttributeTypePrimaryKey projectCustomAttributeTypePrimaryKey, EditViewModel viewModel)
        {
            var projectCustomAttributeType = projectCustomAttributeTypePrimaryKey.EntityObject;

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

            return(new ModalDialogFormJsonResult());
        }
        public ActionResult Edit(ProjectCustomAttributeTypePrimaryKey projectCustomAttributeTypePrimaryKey, EditViewModel viewModel)
        {
            var projectCustomAttributeType = projectCustomAttributeTypePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEdit(viewModel, projectCustomAttributeType));
            }
            viewModel.UpdateModel(projectCustomAttributeType, CurrentFirmaSession);
            SetWarningAboutHiddenRequiredAttributesIfNeeded(projectCustomAttributeType);
            return(new ModalDialogFormJsonResult());
        }
Esempio n. 6
0
        public PartialViewResult Edit(ProjectCustomAttributeTypePrimaryKey projectCustomAttributeTypePrimaryKey)
        {
            var projectCustomAttributeType = projectCustomAttributeTypePrimaryKey.EntityObject;
            var projectTypesSelected       = projectCustomAttributeType.ProjectTypeProjectCustomAttributeTypes
                                             .Select(x => x.ProjectType).Select(x => new ProjectTypeJson(x.ProjectTypeName, x.ProjectTypeID, true))
                                             .ToList();
            var projectTypesUnselected = GetProjectTypeJsonList().Where(x => !projectTypesSelected.Select(y => y.ProjectTypeID).Contains(x.ProjectTypeID));

            projectTypesSelected.AddRange(projectTypesUnselected);
            var projectTypeJsons = projectTypesSelected.OrderBy(x => x.ProjectTypeName).ToList();
            var viewModel        = new EditViewModel(projectCustomAttributeType, projectTypeJsons);

            return(ViewEdit(viewModel, projectCustomAttributeType));
        }
Esempio n. 7
0
        public ActionResult DeleteProjectCustomAttributeType(ProjectCustomAttributeTypePrimaryKey projectCustomAttributeTypePrimaryKey, ConfirmDialogFormViewModel viewModel)
        {
            var projectCustomAttributeType = projectCustomAttributeTypePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteProjectCustomAttributeType(projectCustomAttributeType, viewModel));
            }

            var message = $"{FieldDefinition.ProjectCustomAttribute.GetFieldDefinitionLabel()} '{projectCustomAttributeType.ProjectCustomAttributeTypeName}' successfully deleted!";

            projectCustomAttributeType.DeleteFull(HttpRequestStorage.DatabaseEntities);
            SetMessageForDisplay(message);
            return(new ModalDialogFormJsonResult());
        }
Esempio n. 8
0
 public ContentResult Description(ProjectCustomAttributeTypePrimaryKey projectCustomAttributeTypePrimaryKey)
 {
     return(Content(projectCustomAttributeTypePrimaryKey.EntityObject.ProjectCustomAttributeTypeDescription));
 }