Esempio n. 1
0
        public override void Execute()
        {
            #line 4 "..\..\Views\Shared\EditTemplate.cshtml"

            Layout = "~/Views/Shared/Layouts/_FormDialogLayout.cshtml";

            var title = Model.GetType().GetAttribute <DisplayNameAttribute>()?.DisplayName ?? string.Empty;


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n");

            DefineSection("Footer", () => {
                WriteLiteral("\r\n");


            #line 12 "..\..\Views\Shared\EditTemplate.cshtml"


            #line default
            #line hidden

            #line 12 "..\..\Views\Shared\EditTemplate.cshtml"

                var editRole = ViewData["EditRole"]?.ToString();
                var isDetail = Request.Params["state"] == "detail";


            #line default
            #line hidden
                WriteLiteral("\r\n");

                WriteLiteral("    ");


            #line 16 "..\..\Views\Shared\EditTemplate.cshtml"
                Write(isDetail ? Btn.ButtonForEdit(role: editRole) : Btn.ButtonForSave());


            #line default
            #line hidden
                WriteLiteral("\r\n");
            });

            WriteLiteral("\r\n<form");

            WriteLiteral(" class=\"p15 form-horizontal\"");

            WriteLiteral(" data-title=\"");


            #line 19 "..\..\Views\Shared\EditTemplate.cshtml"
            Write(title);


            #line default
            #line hidden
            WriteLiteral("\"");

            WriteLiteral(">\r\n");

            WriteLiteral("    ");


            #line 20 "..\..\Views\Shared\EditTemplate.cshtml"
            Write(Html.AntiForgeryToken());


            #line default
            #line hidden
            WriteLiteral("\r\n");


            #line 21 "..\..\Views\Shared\EditTemplate.cshtml"


            #line default
            #line hidden

            #line 21 "..\..\Views\Shared\EditTemplate.cshtml"
            foreach (var property in Model.GetType().GetProperties())
            {
            #line default
            #line hidden

            #line 23 "..\..\Views\Shared\EditTemplate.cshtml"
                Write(Html.EditorSectionGridLayout(property.Name));


            #line default
            #line hidden

            #line 23 "..\..\Views\Shared\EditTemplate.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("</form>\r\n");
        }
Esempio n. 2
0
        public override void Execute()
        {
            #line 3 "..\..\Views\Shared\ListTemplate.cshtml"

            Layout = "~/Views/Shared/Layouts/_MainPanelLayout.cshtml";

            var properties = Model.GetType().GetProperties().Where(Orzoo.AspNet.Html.HtmlHelperExtensions.CanBeRendered).ToList();

            var widthDictionary = new Dictionary <string, string>
            {
                { "Name", "200" },
                { "Birth", "150" },
                { "Email", "150" }
            };
            var widths = $"[{string.Join(", ", properties.Select(p => widthDictionary.ContainsKey(p.Name) ? widthDictionary[p.Name] : string.Empty))}, 120]";


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n");


            #line 17 "..\..\Views\Shared\ListTemplate.cshtml"

            var modelDisplay     = Model.GetTypeDisplayName();
            var modelName        = Model.GetType().Name;
            var tplNameLitHeader = $"tpl_{modelName}_index_list_header";
            var tplNameListItem  = $"tpl_{modelName}_index_list_item";


            #line default
            #line hidden
            WriteLiteral("\r\n");

            DefineSection("Title", () => {
                WriteLiteral("\r\n    <i");

                WriteLiteral(" class=\"fa fa-bars\"");

                WriteLiteral("></i>\r\n");

                WriteLiteral("    ");


            #line 26 "..\..\Views\Shared\ListTemplate.cshtml"
                Write(modelDisplay);


            #line default
            #line hidden
                WriteLiteral("\r\n");
            });

            WriteLiteral("\r\n");

            DefineSection("Toolbar", () => {
                WriteLiteral("\r\n");

                WriteLiteral("    ");


            #line 31 "..\..\Views\Shared\ListTemplate.cshtml"
                Write(Btn.ButtonForRefresh(role: ""));


            #line default
            #line hidden
                WriteLiteral("\r\n");

                WriteLiteral("    ");


            #line 32 "..\..\Views\Shared\ListTemplate.cshtml"
                Write(Btn.ButtonForAdd());


            #line default
            #line hidden
                WriteLiteral("\r\n");
            });

            WriteLiteral("\r\n");

            DefineSection("Footer", () => {
                WriteLiteral("\r\n    <div");

                WriteLiteral(" data-role=\"pager\"");

                WriteLiteral(" data-auto-bind=\"false\"");

                WriteLiteral(" data-bind=\"source: source\"");

                WriteLiteral("></div>\r\n");
            });

            WriteLiteral("\r\n");

            DefineSection("Tpl", () => {
                WriteLiteral("\r\n    <script");

                WriteLiteral(" type=\"text/template\"");

                WriteAttribute("id", Tuple.Create(" id=\"", 1076), Tuple.Create("\"", 1100)

            #line 42 "..\..\Views\Shared\ListTemplate.cshtml"
                               , Tuple.Create(Tuple.Create("", 1081), Tuple.Create <System.Object, System.Int32>(tplNameLitHeader

            #line default
            #line hidden
                                                                                                                 , 1081), false)
                               );

                WriteLiteral(">\r\n        <tr>\r\n\r\n");


            #line 45 "..\..\Views\Shared\ListTemplate.cshtml"


            #line default
            #line hidden

            #line 45 "..\..\Views\Shared\ListTemplate.cshtml"
                foreach (var property in properties)
                {
            #line default
            #line hidden

            #line 47 "..\..\Views\Shared\ListTemplate.cshtml"
                    Write(Html.Th(property));


            #line default
            #line hidden

            #line 47 "..\..\Views\Shared\ListTemplate.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            <th>\r\n                操作\r\n            </th>\r\n        </tr>\r\n    </scr" +
                             "ipt>\r\n    <script");

                WriteLiteral(" type=\"text/template\"");

                WriteAttribute("id", Tuple.Create(" id=\"", 1356), Tuple.Create("\"", 1379)

            #line 54 "..\..\Views\Shared\ListTemplate.cshtml"
                               , Tuple.Create(Tuple.Create("", 1361), Tuple.Create <System.Object, System.Int32>(tplNameListItem

            #line default
            #line hidden
                                                                                                                 , 1361), false)
                               );

                WriteLiteral(">\r\n        <tr data-id=\"#: Id #\">\r\n");


            #line 56 "..\..\Views\Shared\ListTemplate.cshtml"


            #line default
            #line hidden

            #line 56 "..\..\Views\Shared\ListTemplate.cshtml"
                foreach (var property in properties)
                {
            #line default
            #line hidden

            #line 58 "..\..\Views\Shared\ListTemplate.cshtml"
                    Write(Html.Td(property));


            #line default
            #line hidden

            #line 58 "..\..\Views\Shared\ListTemplate.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            <td>\r\n                <div class=\"form-inline\">\r\n                    " +
                             "<div class=\"form-group\">\r\n");

                WriteLiteral("                        ");


            #line 63 "..\..\Views\Shared\ListTemplate.cshtml"
                Write(Btn.ButtonForDetail("btn-xs"));


            #line default
            #line hidden
                WriteLiteral("\r\n                    </div>\r\n                    <div class=\"form-group\">\r\n");

                WriteLiteral("                        ");


            #line 66 "..\..\Views\Shared\ListTemplate.cshtml"
                Write(Btn.ButtonForDelete("btn-xs", role: ""));


            #line default
            #line hidden
                WriteLiteral("\r\n                    </div>\r\n                </div>\r\n            </td>\r\n        " +
                             "</tr>\r\n    </script>\r\n");
            });

            WriteLiteral("\r\n<div");

            WriteLiteral(" class=\"grow-inner\"");

            WriteLiteral(">\r\n    <div");

            WriteLiteral(" data-role=\"datatable\"");

            WriteLiteral(" class=\"datatable flexbox\"");

            WriteLiteral("\r\n         data-bind=\"source: source\"");

            WriteLiteral("\r\n         data-template=\"");


            #line 77 "..\..\Views\Shared\ListTemplate.cshtml"
            Write(tplNameListItem);


            #line default
            #line hidden
            WriteLiteral("\"");

            WriteLiteral(" data-header=\"");


            #line 77 "..\..\Views\Shared\ListTemplate.cshtml"
            Write(tplNameLitHeader);


            #line default
            #line hidden
            WriteLiteral("\"");

            WriteLiteral("\r\n         data-widths=\'");


            #line 78 "..\..\Views\Shared\ListTemplate.cshtml"
            Write(widths);


            #line default
            #line hidden
            WriteLiteral("\'");

            WriteLiteral("\r\n         data-table-cls=\"table-hover table-operator table-fixed\"");

            WriteLiteral(">\r\n    </div>\r\n</div>\r\n");
        }