public async Task <UserSearchRet> UserSearch()
        {
            UserSearchRet ret = new UserSearchRet();

            try
            {
                await Task.Run(() =>
                {
                    var userL = UserX.FindAllWithCache();
                    ret.Code  = "200";
                    ret.Msg   = "success";
                    foreach (UserX user in userL)
                    {
                        UserInfo userxx = new UserInfo
                        {
                            Name = user.Name,
                            Code = user.Code,
                        };
                        ret.Data.Add(userxx);
                    }
                });
            }
            catch (Exception e)
            {
                ret.Code = "500";
                ret.Msg  = e.Message;
            }
            return(ret);
        }
Exemplo n.º 2
0
        public override void Execute()
        {
            WriteLiteral("<div");

            WriteLiteral(" class=\"form-group\"");

            WriteLiteral(">\n    <label");

            WriteLiteral(" for=\"category\"");

            WriteLiteral(" class=\"control-label\"");

            WriteLiteral(">类别:</label>\n");

            WriteLiteral("    ");


            #line 3 "..\..\Areas\Admin\Views\Log\_List_Search.cshtml"
            Write(Html.ForDropDownList("category", Log.FindAllCategoryName(), Request["category"], "全部", true));


            #line default
            #line hidden
            WriteLiteral("\n</div>\n<div");

            WriteLiteral(" class=\"form-group\"");

            WriteLiteral(">\n    <label");

            WriteLiteral(" for=\"userid\"");

            WriteLiteral(" class=\"control-label\"");

            WriteLiteral(">用户:</label>\n");

            WriteLiteral("    ");


            #line 7 "..\..\Areas\Admin\Views\Log\_List_Search.cshtml"
            Write(Html.ForDropDownList("userid", UserX.FindAllWithCache().Cast <IEntity>().ToList(), "全部", true));


            #line default
            #line hidden
            WriteLiteral("\n</div>\n");


            #line 9 "..\..\Areas\Admin\Views\Log\_List_Search.cshtml"
            Write(Html.Partial("_DateRange"));


            #line default
            #line hidden
        }
Exemplo n.º 3
0
        static void Test9()
        {
            var user = UserX.FindAllWithCache()[0];

            Console.WriteLine(user.RoleName);
            Console.Clear();

            //var bn = new Binary();
            //bn.EnableTrace();
            var bn = new Xml();

            bn.Write(user);

            var sw = new Stopwatch();

            sw.Start();

            var buf = bn.GetBytes();

            Console.WriteLine(buf.ToHex());
            Console.WriteLine(bn.GetString());

            var ms = new MemoryStream(buf);

            //bn = new Binary();
            bn.Stream = ms;
            //bn.EnableTrace();
            var u = bn.Read <UserX>();

            foreach (var item in UserX.Meta.AllFields)
            {
                if (user[item.Name] == u[item.Name])
                {
                    Console.WriteLine("{0} {1} <=> {2} 通过", item.Name, user[item.Name], u[item.Name]);
                }
                else
                {
                    Console.WriteLine("{0} {1} <=> {2} 失败", item.Name, user[item.Name], u[item.Name]);
                }
            }

            //var hi = HardInfo.Current;
            //sw.Stop();
            //Console.WriteLine(sw.Elapsed);
            //Console.WriteLine(hi);

            //var ci = new ComputerInfo();
            //Console.WriteLine(ci);
        }
Exemplo n.º 4
0
        public override void Execute()
        {
            #line 4 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"

            var fact = ViewBag.Factory as IEntityOperate;
            var page = ViewBag.Page as Pager;


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

            WriteLiteral(" class=\"tableTools-container list-toolbar\"");

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

            WriteLiteral(" class=\"form-inline clear-fix\"");

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

            WriteAttribute("action", Tuple.Create(" action=\"", 253), Tuple.Create("\"", 333)

            #line 10 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
                           , Tuple.Create(Tuple.Create("", 262), Tuple.Create <System.Object, System.Int32>(Url.Action("index")

            #line default
            #line hidden
                                                                                                            , 262), false)

            #line 10 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
                           , Tuple.Create(Tuple.Create("", 282), Tuple.Create <System.Object, System.Int32>(Html.Raw("?" + page.GetBaseUrl(false, true, true))

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

            WriteLiteral(" method=\"post\"");

            WriteLiteral(" role=\"form\"");

            WriteLiteral(">\r\n");


            #line 11 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"


            #line default
            #line hidden

            #line 11 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
            if (ManageProvider.User.Has(PermissionFlags.Insert))
            {
            #line default
            #line hidden

            #line 13 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
                Write(Html.ActionLink("添加" + ViewContext.Controller.GetType().GetDisplayName(), "Add", null, new { @class = "btn btn-success btn-sm" }));


            #line default
            #line hidden

            #line 13 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("            <div");

            WriteLiteral(" class=\"pull-right form-group\"");

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

            WriteLiteral(" class=\"form-group\"");

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

            WriteLiteral(" for=\"category\"");

            WriteLiteral(" class=\"control-label\"");

            WriteLiteral(">类别:</label>\r\n");

            WriteLiteral("                    ");


            #line 18 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
            Write(Html.ForDropDownList("category", Log.FindAllCategoryName(), Request["category"], "全部", true));


            #line default
            #line hidden
            WriteLiteral("\r\n                </div>\r\n                <div");

            WriteLiteral(" class=\"form-group\"");

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

            WriteLiteral(" for=\"adminid\"");

            WriteLiteral(" class=\"control-label\"");

            WriteLiteral(">用户:</label>\r\n");

            WriteLiteral("                    ");


            #line 22 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
            Write(Html.ForDropDownList("adminid", UserX.FindAllWithCache(), "全部", true));


            #line default
            #line hidden
            WriteLiteral("\r\n                </div>\r\n                <div");

            WriteLiteral(" class=\"form-group\"");

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

            WriteLiteral(" for=\"dtStart\"");

            WriteLiteral(" class=\"control-label\"");

            WriteLiteral(">时间:</label>\r\n                    <div");

            WriteLiteral(" class=\"input-group\"");

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

            WriteLiteral(" class=\"input-group-addon\"");

            WriteLiteral("><i");

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

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

            WriteLiteral(" name=\"dtStart\"");

            WriteLiteral(" id=\"dtStart\"");

            WriteAttribute("value", Tuple.Create(" value=\"", 1467), Tuple.Create("\"", 1494)

            #line 28 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
                           , Tuple.Create(Tuple.Create("", 1475), Tuple.Create <System.Object, System.Int32>(Request["dtStart"]

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

            WriteLiteral(" dateformat=\"yyyy-MM-dd\"");

            WriteLiteral(" class=\"form-control form_datetime\"");

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

            WriteLiteral(" class=\"form-group\"");

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

            WriteLiteral(" for=\"dtEnd\"");

            WriteLiteral(" class=\"control-label\"");

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

            WriteLiteral(" class=\"input-group\"");

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

            WriteLiteral(" class=\"input-group-addon\"");

            WriteLiteral("><i");

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

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

            WriteLiteral(" name=\"dtEnd\"");

            WriteLiteral(" id=\"dtEnd\"");

            WriteAttribute("value", Tuple.Create(" value=\"", 1921), Tuple.Create("\"", 1946)

            #line 35 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
                           , Tuple.Create(Tuple.Create("", 1929), Tuple.Create <System.Object, System.Int32>(Request["dtEnd"]

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

            WriteLiteral(" dateformat=\"yyyy-MM-dd\"");

            WriteLiteral(" class=\"form-control form_datetime\"");

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

            WriteLiteral(" class=\"input-group btn-toolbar\"");

            WriteLiteral(">\r\n");

            WriteLiteral("                    ");


            #line 39 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
            Write(Html.Partial("_List_Toolbar_Search"));


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

            WriteLiteral("                    ");


            #line 40 "..\..\Areas\Admin\Views\Log\_List_Toolbar.cshtml"
            Write(Html.Partial("_List_Toolbar_Adv"));


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