Exemplo n.º 1
0
        public static MvcHtmlString CheckBoxListFor <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, string nameSuffix, string codeCategory, string vTenantID, string vTenantFlag, RepeatDirection repeatDirection = RepeatDirection.Horizontal)
        {
            var           codes             = CodeManager.GetCodes(codeCategory, vTenantID, vTenantFlag);
            ModelMetadata metadata          = ModelMetadata.FromLambdaExpression <TModel, TProperty>(expression, htmlHelper.ViewData);
            string        name              = ExpressionHelper.GetExpressionText(expression);
            string        fullHtmlFieldName = htmlHelper.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(name) + "_" + nameSuffix;

            return(ListControlUtil.GenerateHtml(fullHtmlFieldName, codes, repeatDirection, "checkbox", metadata.Model));
        }
Exemplo n.º 2
0
        public static MvcHtmlString CheckBoxList(this HtmlHelper htmlHelper, string name, string codeCategory, string vTenantID, string vTenantFlag, RepeatDirection repeatDirection = RepeatDirection.Horizontal)
        {
            var codes = CodeManager.GetCodes(codeCategory, vTenantID, vTenantFlag);

            return(ListControlUtil.GenerateHtml(name, codes, repeatDirection, "checkbox", null));
        }