Esempio n. 1
0
        private MvcHtmlString WriteCategory(CategoryViewData category)
        {
            if (display == CategoryDisplay.Edit)
            {
                return(MvcHtmlString.Create("{0} {1} {2} {3} {4}".With(
                                                WriteCategoryLink(category),
                                                htmlHelper.ActionLink <CategoryController>(c => c.Edit(category.CategoryId), "Edit"),
                                                htmlHelper.Tick(category.IsActive),
                                                htmlHelper.UpArrowLink <CategoryController>(c => c.MoveUp(category.CategoryId)),
                                                htmlHelper.DownArrowLink <CategoryController>(c => c.MoveDown(category.CategoryId))
                                                )));
            }

            return(WriteCategoryLink(category));
        }
Esempio n. 2
0
 protected ApplicationViewData(Application application, IList <Category> categories, bool canGetSecretKey, IList <Guid> standards)
     : base(application)
 {
     Developer   = DeveloperViewData.Create(application.Developer);
     Permissions = ApplicationPersmissionsViewData.Create(application.Permissions);
     if (canGetSecretKey)
     {
         SecretKey = application.SecretKey;
     }
     categories  = categories.Where(x => application.Categories.Any(y => y.CategoryRef == x.Id)).ToList();
     Categories  = CategoryViewData.Create(categories);
     GradeLevels = application.GradeLevels.Select(x => x.GradeLevel).ToList();
     //if (application.ApplicationStandards != null && standards != null)
     //    Standards = CommonCoreStandardViewData.Create(
     //            standards.Where(x => application.ApplicationStandards.Any(y => y.StandardRef == x.Id))
     //                     .ToList());
 }
Esempio n. 3
0
        public static string WriteCategories(this HtmlHelper htmlHelper, CategoryViewData rootCategory, CategoryDisplay display)
        {
            var categoryWriter = new CategoryWriter(rootCategory, htmlHelper, display);

            return(categoryWriter.Write());
        }
Esempio n. 4
0
 private MvcHtmlString WriteCategoryLink(CategoryViewData category)
 {
     return(htmlHelper.ActionLink <ProductController>(c => c.Category(category.UrlName), category.Name));
 }
Esempio n. 5
0
 public CategoryWriter(CategoryViewData rootCategory, HtmlHelper htmlHelper, CategoryDisplay display)
 {
     this.rootCategory = rootCategory;
     this.htmlHelper   = htmlHelper;
     this.display      = display;
 }