コード例 #1
0
 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));
 }
コード例 #2
0
 /// <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);
 }
コード例 #3
0
ファイル: IndexGridSpec.cs プロジェクト: sitkatech/alevin
        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)
        }
コード例 #4
0
ファイル: IndexViewData.cs プロジェクト: sitkatech/alevin
        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;
        }
コード例 #5
0
        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));
        }
コード例 #6
0
 /// <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));
 }
コード例 #7
0
 public EditViewData(ProjectFirmaModels.Models.ClassificationSystem classificationSystem,
                     ProjectFirmaModels.Models.Classification classification)
 {
     ClassificationSystem = classificationSystem;
     Classification       = classification;
 }