예제 #1
0
        private string GenerateMenus(int indent)
        {
            var          topLi     = "<li" + General.SetValue("class", "nav-item px-3") + ">";
            const string topNav    = "<NavLink";
            const string bottomNav = "</NavLink>";
            const string bottomLi  = "</li>";

            BuildSnippet(null);
            var x = 0;

            foreach (var table in _tables)
            {
                x++;
                var navLink = General.SetValue("class", "nav-link") + General.SetValue("href", table.TableName.Pluralize().ToLower());
                var span    = General.SetValue("class", "oi oi-list-rich") + General.SetValue("aria-hidden");
                span = span.OpenTag("span") + span.CloseTag("span");
                BuildSnippet(topLi, indent);
                BuildSnippet(topNav + navLink + ">", indent + 4);
                BuildSnippet(span + " " + table.TableName.Pluralize(), indent + 8);
                BuildSnippet(bottomNav, indent + 4);
                BuildSnippet(bottomLi, indent);
            }
            return(BuildSnippet());
            //var row = General.CreateRow("span", span);
            //properties.OpenTag(tag) + properties.CloseTag(tag)
        }
예제 #2
0
 public static string ColumnField(this ISchemaItem schemaItem)
 {
     //return  _space + "Field=@nameof(" + schemaItem.TableName + "." + schemaItem.ColumnName + ")";
     return(_space +
            General.SetValue("Field", schemaItem.ColumnName)); //+
     //General.SetValue("TValue", schemaItem.TableName) + ")";
 }
예제 #3
0
        private string EjsDataManager(int indent, bool setEditSettings = true)
        {
            BuildSnippet(null);
            var result = General.SetValue("Url", "/api/" + _table) + General.SetValue("Adaptor", "Adaptors.WebApiAdaptor");

            result = General.CreateRow("EjsDataManager", result, indent);
            return(result);
        }
예제 #4
0
        private string GridEditSettings(int indent, bool setEditSettings = true)
        {
            var result = string.Empty;

            if (setEditSettings)
            {
                BuildSnippet(null);
                result = General.SetValue("AllowAdding") + General.SetValue("AllowDeleting") + General.SetValue("AllowEditing");
                result = General.CreateRow("GridEditSettings", result, indent);
            }
            return(result);
        }
예제 #5
0
        private string DataSourceSettings(bool setSettings = true)
        {
            //var result = SetValue("DataSource","@GridData");
            var result = General.SetValue("@ref", "@Grid");

            result += General.SetValue("TValue", _table);
            result += General.SetValue("Toolbar", "@(new List<string> {" +
                                       "Add".AddQuotes() + "," +
                                       "Edit".AddQuotes() + "," +
                                       "Delete".AddQuotes() + "," +
                                       "Update".AddQuotes() + "," +
                                       "Cancel".AddQuotes() + " })");

            if (setSettings)
            {
                BuildSnippet(null);

                //Use Context Menu
                if (ConfigValue("UseContextMenu"))
                {
                    result += ContextMenuString();
                }

                //Use GridLines
                if (ConfigValue("UseGridLines"))
                {
                    result += General.SetValue("GridLines", "GridLine.Both");
                }

                //Use Grouping
                if (ConfigValue("AllowGrouping"))
                {
                    result += General.SetValue("AllowGrouping");
                }

                result = (result + General.SetValue("AllowPaging"));
            }
            return(result);
        }