public ClassificationSystemViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.ClassificationSystem classificationSystem) : base(currentFirmaSession) { PageTitle = ClassificationSystemModelExtensions.GetClassificationSystemNamePluralized(classificationSystem); Classifications = classificationSystem.Classifications.SortByOrderThenName().ToList(); ClassificationSystem = classificationSystem; ShowEditButton = new FirmaPageManageFeature().HasPermission(currentFirmaSession, null).HasPermission; EditPageContentUrl = SitkaRoute <ClassificationSystemController> .BuildUrlFromExpression(t => t.EditInDialog(classificationSystem)); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public Classification(string themeColor, string displayName, ClassificationSystem classificationSystem) : this() { // Mark this as a new object by setting primary key with special value this.ClassificationID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.ThemeColor = themeColor; this.DisplayName = displayName; this.ClassificationSystemID = classificationSystem.ClassificationSystemID; this.ClassificationSystem = classificationSystem; classificationSystem.Classifications.Add(this); }
public IndexGridSpec(bool hasDeletePermissions, ProjectFirmaModels.Models.ClassificationSystem classificationSystem) { if (hasDeletePermissions) { Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(x.GetDeleteUrl(), true, !x.HasDependentObjects()), 30, DhtmlxGridColumnFilterType.None); } Add(classificationSystem.ToGridHeaderString(), a => a.GetDisplayNameAsUrl(), 250); Add(FieldDefinitionEnum.ClassificationDescription.ToType().ToGridHeaderString("Description"), a => a.ClassificationDescription, 250); Add(FieldDefinitionEnum.ClassificationDescription.ToType().ToGridHeaderString("Goal Statement"), a => a.GoalStatement, 250); Add($"# of {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", a => a.ProjectClassifications.Count, 90); Add("Sort Order", a => a.ClassificationSortOrder, 90, DhtmlxGridColumnFormatType.None); // Most humans ordinarily expect lists to be 1-indexed instead of zero-indexed) }
public IndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.ClassificationSystem classificationSystem) : base(currentFirmaSession) { PageTitle = ClassificationSystemModelExtensions.GetClassificationSystemNamePluralized(classificationSystem); HasClassificationManagePermissions = new FirmaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession); GridSpec = new IndexGridSpec(HasClassificationManagePermissions, classificationSystem) { ObjectNameSingular = classificationSystem.ClassificationSystemName, ObjectNamePlural = ClassificationSystemModelExtensions.GetClassificationSystemNamePluralized(classificationSystem), SaveFiltersInCookie = true, }; GridName = "classificationsGrid"; GridDataUrl = SitkaRoute <ClassificationController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData(classificationSystem)); NewUrl = SitkaRoute <ClassificationController> .BuildUrlFromExpression(tc => tc.New(classificationSystem)); EditSortOrderUrl = SitkaRoute <ClassificationController> .BuildUrlFromExpression(tc => tc.EditSortOrder(classificationSystem)); ClassificationSystemName = classificationSystem.ClassificationSystemName; }
private PartialViewResult ViewEditInDialog(EditPageContentViewModel viewModel, ProjectFirmaModels.Models.ClassificationSystem classificationSystem) { var ckEditorToolbar = CkEditorExtension.CkEditorToolbar.Minimal; var viewData = new EditPageContentViewData(ckEditorToolbar); return(RazorPartialView <EditPageContent, EditPageContentViewData, EditPageContentViewModel>(viewData, viewModel)); }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static Classification CreateNewBlank(ClassificationSystem classificationSystem) { return(new Classification(default(string), default(string), default(string), classificationSystem)); }
public EditViewData(ProjectFirmaModels.Models.ClassificationSystem classificationSystem, ProjectFirmaModels.Models.Classification classification) { ClassificationSystem = classificationSystem; Classification = classification; }