Ejemplo n.º 1
0
        public void TestMethod1()
        {
            SysMenuService sysMenuService = new SysMenuService();
            UserService    userService    = new UserService();

            userService.isSave = false;
            User user  = userService.GetUser();
            User user1 = new User()
            {
                Email       = "*****@*****.**",
                LogingName  = "LJY",
                Password    = "******",
                UserName    = "******",
                CreateUser  = "******",
                CredateTime = DateTime.Now
            };

            userService.Add(user1);
            userService.Update(user);
            SysMenu sysMenu = new SysMenu()
            {
                CreateUser  = "******",
                CredateTime = DateTime.Now,
                Icon        = "123",
                LinkUrl     = "123",
                MenuCode    = "T1",
                MenuLevel   = 1,
                MenuName    = "Test1",
                ParentID    = 0,
                SortNumber  = 1
            };

            sysMenuService.AddSysMenu(sysMenu);
            sysMenuService.GeSysMenu();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            SysMenuService sysMenuService = new SysMenuService();
            UserService    userService    = new UserService();

            userService.isSave = false;
            User user = new User()
            {
                Email       = "*****@*****.**",
                LogingName  = "LJY",
                Password    = "******",
                UserName    = "******",
                CreateUser  = "******",
                CredateTime = DateTime.Now
            };

            //for (int i = 0; i < 1000000; i++)
            //{
            //    Thread.Sleep(100);
            //    user.CredateTime = DateTime.Now;
            //    int id = userService.Add(user);
            //    Console.WriteLine("添加成功,不提交");
            //}
            for (int i = 0; i < 10000; i++)
            {
                SysMenu sysMenu = new SysMenu()
                {
                    CreateUser  = "******",
                    CredateTime = DateTime.Now,
                    Icon        = "",
                    LinkUrl     = "123",
                    MenuCode    = "T",
                    MenuLevel   = 1,
                    MenuName    = "Test",
                    ParentID    = 0,
                    SortNumber  = 1
                };
                int id = sysMenuService.AddSysMenu(sysMenu);
                sysMenuService.GeSysMenu();
                if (id > 0)
                {
                    Console.WriteLine("添加成功,提交");
                }
            }
        }