Example #1
0
        protected string FormFieldReplace(Context configContext, TableInfo tableInfo, Info info, string textTemplateForm, string str = "")
        {
            var cols = "col-md-12";

            if (tableInfo.TwoCols || configContext.TwoCols)
            {
                cols = "col-md-6";
            }

            if (IsStringLengthBig(info, configContext))
            {
                cols = "col-md-12";
            }

            var colSize = HelperFieldConfig.GetColSizeField(tableInfo, info.PropertyName);

            if (colSize.IsSent())
            {
                cols = string.Format("col-md-{0}", colSize);
            }

            return(textTemplateForm
                   .Replace("<#formField#>", str)
                   .Replace("<#colformField#>", cols.ToString()));
        }
        protected string FormFieldReplace(Context configContext, TableInfo tableInfo, Info info, string textTemplateForm, string str = "")
        {
            var attrSectionFieldConfig = HelperFieldConfig.GetAttrSection(tableInfo, info.PropertyName);

            if (IsPropertyNavigationTypeInstance(tableInfo, info.PropertyName))
            {
                if (!attrSectionFieldConfig.Contains("ngIf"))
                {
                    var conditionalParent = "*ngIf=\"!vm.isParent || vm.ParentIdField != '<#propertyName#>'\"";
                    attrSectionFieldConfig += " " + conditionalParent;
                }
            }

            var cols = "col-md-12";

            if (tableInfo.TwoCols || configContext.TwoCols)
            {
                cols = "col-md-6";
            }

            if (IsStringLengthBig(info, configContext))
            {
                cols = "col-md-12";
            }

            var colSize = HelperFieldConfig.GetColSizeField(tableInfo, info.PropertyName);

            if (colSize.IsSent())
            {
                cols = string.Format("col-md-{0}", colSize);
            }

            return(textTemplateForm
                   .Replace("<#formField#>", str)
                   .Replace("<#colformField#>", cols.ToString())
                   .Replace("<#attrSection#>", attrSectionFieldConfig));
        }