Exemplo n.º 1
0
 /// <summary>
 /// 构建表格
 /// </summary>
 public void OnBuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupForCrudPage <PaymentTransactionRecordsApp>();
     searchBar.StandardSetupForCrudPage <PaymentTransactionRecordsApp>(
         "Serial/Payer/Payee/Description/Remark");
 }
 /// <summary>
 /// 构建表格时的处理
 /// </summary>
 public void OnBuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.ExtraOptions["pageSize"]       = int.MaxValue;
     table.ExtraOptions["hidePagination"] = true;
     table.MenuItems.AddToggleAllForAjaxTableTree("Level");
     table.MenuItems.AddDivider();
     table.MenuItems.AddEditAction(
         Builder.Type, Builder.EditUrl, dialogParameters: new { size = "size-wide" });
     table.MenuItems.AddAddAction(
         Builder.Type, Builder.AddUrl,
         name: new T("Add Top Level Class"), dialogParameters: new { size = "size-wide" });
     table.MenuItems.AddRemoteModalForSelectedRow(
         new T("Add Same Level Class"), "fa fa-plus",
         string.Format(new T("Add {0}"), new T(Builder.Type)),
         Builder.AddUrl + "?parentId=<%-row.ParentId%>", new { size = "size-wide" });
     table.MenuItems.AddRemoteModalForSelectedRow(
         new T("Add Child Class"), "fa fa-plus",
         string.Format(new T("Add {0}"), new T(Builder.Type)),
         Builder.AddUrl + "?parentId=<%-row.Id%>", new { size = "size-wide" });
     searchBar.KeywordPlaceHolder = "Name/Remark";
     searchBar.MenuItems.AddDivider();
     searchBar.MenuItems.AddRecycleBin();
     searchBar.MenuItems.AddAddAction(
         Builder.Type, Builder.AddUrl,
         name: new T("Add Top Level Class"), dialogParameters: new { size = "size-wide" });
     searchBar.BeforeItems.AddAddAction(
         Builder.Type, Builder.AddUrl,
         name: new T("Add Top Level Class"), dialogParameters: new { size = "size-wide" });
 }
Exemplo n.º 3
0
 /// <summary>
 /// 构建表格
 /// </summary>
 public override void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <ProductPropertyCrudController>();
     searchBar.StandardSetupFor <ProductPropertyCrudController>("Name/Remark");
     searchBar.Conditions.Add(new FormField(new CheckBoxFieldAttribute("IsSalesProperty")));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 构建表格
 /// </summary>
 public override void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <PaymentTransactionCrudController>();
     searchBar.StandardSetupFor <PaymentTransactionCrudController>(
         "Serial/Payer/Payee/Description/Remark");
 }
 /// <summary>
 /// 构建表格
 /// </summary>
 public override void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <BuyerOrderCrudController>();
     table.Template = "/static/shopping.order.tmpl/orderTable.tmpl";
     searchBar.StandardSetupFor <BuyerOrderCrudController>("Serial/Remark");
     searchBar.BeforeItems.AddOrderFilterBar();
     searchBar.Conditions.Add(new FormField(new TextBoxFieldAttribute("Seller")));
     searchBar.Conditions.Add(new FormField(new DropdownListFieldAttribute(
                                                "RemarkFlags", typeof(ListItemsWithOptional <ListItemFromEnum <OrderRemarkFlags> >))));
 }
        public IActionResult AjaxTable()
        {
            var table = new AjaxTableBuilder();

            table.Id     = "ExampleTable";
            table.Target = "/example/ajax_table_search";
            var searchBar = new AjaxTableSearchBarBuilder();

            searchBar.TableId = table.Id;
            searchBar.Conditions.Add(new FormField(new CheckBoxFieldAttribute("Deleted")));
            return(new TemplateResult("zkweb.examples/ajax_table.html", new { table, searchBar }));
        }
 /// <summary>
 /// 构建表格
 /// </summary>
 public override void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <ProductCrudController>();
     searchBar.StandardSetupFor <ProductCrudController>("Name/Remark");
     searchBar.Conditions.Add(new FormField(new DropdownListFieldAttribute(
                                                "ProductType", typeof(ListItemsWithOptional <ProductTypeListItemProvider>))));
     searchBar.Conditions.Add(new FormField(new DropdownListFieldAttribute(
                                                "ProductState", typeof(ListItemsWithOptional <ProductStateListItemProvider>))));
     searchBar.Conditions.Add(new FormField(new DropdownListFieldAttribute(
                                                "ProductClass", typeof(ListItemsWithOptional <GenericClassListItemProvider <ProductClassController> >))));
     searchBar.Conditions.Add(new FormField(new DropdownListFieldAttribute(
                                                "ProductTag", typeof(ListItemsWithOptional <GenericTagListItemProvider <ProductTagController> >))));
 }
            /// <summary>
            /// 构建表格时的处理
            /// </summary>
            public override void BuildTable(
                AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
            {
                var app = new TController();
                var dialogParameters = new { size = "size-wide" };

                table.MenuItems.AddDivider();
                table.MenuItems.AddEditAction(app.Type, app.EditUrl, dialogParameters: dialogParameters);
                table.MenuItems.AddAddAction(app.Type, app.AddUrl, dialogParameters: dialogParameters);
                searchBar.KeywordPlaceHolder = "Name/Remark";
                searchBar.MenuItems.AddDivider();
                searchBar.MenuItems.AddRecycleBin();
                searchBar.MenuItems.AddAddAction(app.Type, app.AddUrl, dialogParameters: dialogParameters);
                searchBar.BeforeItems.AddAddAction(app.Type, app.AddUrl, dialogParameters: dialogParameters);
            }
Exemplo n.º 9
0
 /// <summary>
 /// 构建表格时的处理
 /// </summary>
 public void OnBuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.MenuItems.AddDivider();
     table.MenuItems.AddEditAction(
         Builder.Type, Builder.EditUrl, dialogParameters: new { size = "size-wide" });
     table.MenuItems.AddAddAction(
         Builder.Type, Builder.AddUrl, dialogParameters: new { size = "size-wide" });
     searchBar.KeywordPlaceHolder = "Name/Remark";
     searchBar.MenuItems.AddDivider();
     searchBar.MenuItems.AddRecycleBin();
     searchBar.MenuItems.AddAddAction(
         Builder.Type, Builder.AddUrl, dialogParameters: new { size = "size-wide" });
     searchBar.BeforeItems.AddAddAction(
         Builder.Type, Builder.AddUrl, dialogParameters: new { size = "size-wide" });
 }
        /// <summary>
        /// 对增删查改页面使用的搜索栏构建器进行标准的设置
        /// 添加以下菜单项
        /// - 回收站(如果数据支持回收)
        /// - 添加菜单(如果添加Url不是空)
        /// 添加以下按钮
        /// - 添加按钮(如果添加Url不是空)
        /// </summary>
        /// <typeparam name="TCrudController">控制器的类型</typeparam>
        /// <param name="searchBar">搜索栏构建器</param>
        /// <param name="keywordPlaceHolder">关键词的预留文本,传入后会自动翻译,可传入原文</param>
        public static void StandardSetupFor <TCrudController>(
            this AjaxTableSearchBarBuilder searchBar, string keywordPlaceHolder)
            where TCrudController : class, ICrudController, new()
        {
            var app = new TCrudController();

            searchBar.KeywordPlaceHolder = new T(keywordPlaceHolder);
            var addDividerOnce = new Lazy <Action>(
                () => { searchBar.MenuItems.AddDivider(); return(() => { }); });

            if (app.AllowDeleteRecover)
            {
                addDividerOnce.Value();
                searchBar.MenuItems.AddRecycleBin();
            }
            if (!string.IsNullOrEmpty(app.AddUrl))
            {
                addDividerOnce.Value();
                searchBar.MenuItems.AddAddActionFor <TCrudController>();
                searchBar.BeforeItems.AddAddActionFor <TCrudController>();
            }
        }
        /// <summary>
        /// 对增删查改页面使用的搜索栏构建器进行标准的设置
        /// 添加以下菜单项
        /// - 回收站(如果数据支持回收)
        /// - 添加菜单(如果添加Url不是空)
        /// 添加以下按钮
        /// - 添加按钮(如果添加Url不是空)
        /// </summary>
        /// <typeparam name="TBuilder">后台应用类型</typeparam>
        /// <param name="searchBar">搜索栏构建器</param>
        /// <param name="keywordPlaceHolder">关键词的预留文本,传入后会自动翻译,可传入原文</param>
        public static void StandardSetupForCrudPage <TBuilder>(
            this AjaxTableSearchBarBuilder searchBar, string keywordPlaceHolder)
            where TBuilder : class, ICrudPageBuilder, new()
        {
            var app = new TBuilder();

            searchBar.KeywordPlaceHolder = new T(keywordPlaceHolder);
            var addDividerOnce = new Lazy <Action>(
                () => { searchBar.MenuItems.AddDivider(); return(() => { }); });

            if (RecyclableTrait.For(app.DataType).IsRecyclable)
            {
                addDividerOnce.Value();
                searchBar.MenuItems.AddRecycleBin();
            }
            if (!string.IsNullOrEmpty(app.AddUrl))
            {
                addDividerOnce.Value();
                searchBar.MenuItems.AddAddActionForCrudPage <TBuilder>();
                searchBar.BeforeItems.AddAddActionForCrudPage <TBuilder>();
            }
        }
Exemplo n.º 12
0
 /// <summary>
 /// 构建表格时的处理
 /// </summary>
 public override void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <UserRoleCrudController>();
     searchBar.StandardSetupFor <UserRoleCrudController>("Name/Remark");
 }
 public void BuildTable(AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     searchBar.Conditions.Add(new FormField(new TextBoxFieldAttribute("Contact Information")));
 }
Exemplo n.º 14
0
 /// <summary>
 /// 构建表格时的处理
 /// </summary>
 public void OnBuildTable(AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupForCrudPage <UserManageApp>();
     searchBar.StandardSetupForCrudPage <UserManageApp>("Username");
 }
 /// <summary>
 /// 构建表格
 /// </summary>
 public override void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <PaymentApiCrudController>();
     searchBar.StandardSetupFor <PaymentApiCrudController>("Name/Owner/Remark");
 }
Exemplo n.º 16
0
 /// <summary>
 /// 构建表格时的处理
 /// </summary>
 public override void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <UserCrudController>();
     searchBar.StandardSetupFor <UserCrudController>("Username");
 }
Exemplo n.º 17
0
 /// <summary>
 /// 构建表格
 /// </summary>
 public override void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <ArticleCrudController>();
     searchBar.StandardSetupFor <ArticleCrudController>("Title/Summary/Author");
 }
Exemplo n.º 18
0
 public void OnBuildTable(AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
 }
 /// <summary>
 /// 构建表格
 /// </summary>
 public void OnBuildTable(AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupForCrudPage <UserShippingAddressManage>();
     searchBar.StandardSetupForCrudPage <UserShippingAddressManage>("Address/Name/Tel");
 }
Exemplo n.º 20
0
 /// <summary>
 /// 构建表格
 /// </summary>
 public void OnBuildTable(AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupForCrudPage <ProductCategoryManageApp>();
     searchBar.StandardSetupForCrudPage <ProductCategoryManageApp>("Name/Remark");
 }
Exemplo n.º 21
0
 /// <summary>
 /// 构建表格
 /// </summary>
 public void OnBuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupForCrudPage <PaymentApiManageApp>();
     searchBar.StandardSetupForCrudPage <PaymentApiManageApp>("Name/Owner/Remark");
 }
 /// <summary>
 /// 构建表格
 /// </summary>
 public void OnBuildTable(AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupForCrudPage <ProductPropertyManageApp>();
     searchBar.StandardSetupForCrudPage <ProductPropertyManageApp>("Name/Remark");
     searchBar.Conditions.Add(new FormField(new CheckBoxFieldAttribute("IsSalesProperty")));
 }
Exemplo n.º 23
0
 /// <summary>
 /// 构建表格
 /// </summary>
 public void OnBuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupForCrudPage <ArticleManageApp>();
     searchBar.StandardSetupForCrudPage <ArticleManageApp>("Title/Summary/Author");
 }
Exemplo n.º 24
0
 public override void BuildTable(AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <ExampleCrudController>();                // 设置表格
     searchBar.StandardSetupFor <ExampleCrudController>("Name");      // 设置搜索栏
 }
Exemplo n.º 25
0
 /// <summary>
 /// 构建表格
 /// </summary>
 public void OnBuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupForCrudPage <LogisticsManageApp>();
     searchBar.StandardSetupForCrudPage <LogisticsManageApp>("Name/Remark");
 }
Exemplo n.º 26
0
 /// <summary>
 /// 构建表格
 /// </summary>
 public override void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <ProductBookmarkCrudController>();
     searchBar.StandardSetupFor <ProductBookmarkCrudController>("Name/Seller");
 }
Exemplo n.º 27
0
 /// <summary>
 /// 构建表格时的处理
 /// </summary>
 public virtual void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
 }
Exemplo n.º 28
0
 /// <summary>
 /// 构建表格
 /// </summary>
 public override void BuildTable(
     AjaxTableBuilder table, AjaxTableSearchBarBuilder searchBar)
 {
     table.StandardSetupFor <ShippingAddressCrudController>();
     searchBar.StandardSetupFor <ShippingAddressCrudController>("Address/Name/Tel");
 }