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

            return(ViewDeleteProjectCustomAttributeType(projectCustomAttributeType, viewModel));
        }
示例#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));
        }
示例#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());
        }
示例#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));
        }
示例#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());
        }
示例#8
0
 public ContentResult Description(ProjectCustomAttributeTypePrimaryKey projectCustomAttributeTypePrimaryKey)
 {
     return(Content(projectCustomAttributeTypePrimaryKey.EntityObject.ProjectCustomAttributeTypeDescription));
 }