<#@ template language="C#" #> <#@ assembly name="System.Core" #> <#@ import namespace="System.Linq" #> <#@ import namespace="System.Text" #> <#@ import namespace="System.Collections.Generic" #> @using <#=Model.ProjectName#>.Web.Models.Input @using <#=Model.ProjectName#>.Web.Models.Modals @using <#=Model.ProjectName#>.Web.Models.Search @using <#=Model.ProjectName#>.Web.Models.Table @using VberZero @{ ViewBag.Title = "<#=Model.HtmlPageTitle#>"; string activeMenu = PermissionNames.Vber<#=Model.ParentPath#><#=Model.FileName#>Mg; //The menu item will be active for this page. ViewBag.ActiveMenu = activeMenu; var searchForm = new VmSearch(new List() { <# foreach (var item in Model.Columns) { if(!item.IsGenreated) continue; if(item.IsSearch) { var typeStr= item.AttrType=="int"?"FType.I": item.AttrType=="int"?"FType.In": item.AttrType=="DateTime"?"FType.D": item.AttrType=="DateTime?"?"FType.Dn":""; typeStr= string.IsNullOrEmpty(typeStr)?"":".WithFieldType("+typeStr+")"; #> new VmSearchItem("<#=item.CamelColumnName#>","<#=item.Comment#>")<#=typeStr#>, <# } } #> }); var table = new VmTable(VzConsts.ApiAppUrl + "<#=Model.FileName#>/GetAll", activeMenu, searchForm) .AddItems(new List() { <# foreach (var item in Model.Columns) { if(!item.IsGenreated) continue; if(item.IsTable) { #> new VmTableItem("<#=item.CamelColumnName#>", "<#=item.Comment#>"), <# } } #> }); var modalBody = new VmModalBody() .AddInputs(new List { new VmInputHidden("id"), }) .AddGroup(new List { <# foreach (var item in Model.Columns) { if(!item.IsGenreated) continue; if(!item.IsModal) continue; var inputType=item.AttrType=="int"?"VmInputNumber": item.AttrType=="int?"?"VmInputNumber": item.AttrType=="DateTime"?"VmInputDate": item.AttrType=="DateTime?"?"VmInputDate":"VmInput"; if(item.IsRequired) { #> new <#=inputType#>("<#=item.CamelColumnName#>", "<#=item.Comment#>").WithRequired(), <# }else{ #> new <#=inputType#>("<#=item.CamelColumnName#>", "<#=item.Comment#>"), <# } #> <# } #> },2); var modal = new VmModal().WithHeaderAndFooter("<#=Model.HtmlModalTitle#>","").WithBody(modalBody); } @section styles{ } @await Html.PartialAsync("_Table", table) @await Html.PartialAsync("_Modal", modal) @section scripts { }