Пример #1
0
        public void TestAdd()
        {
            var request = new Request<Role>()
            {
                Obj = new Role()
                {
                    RoleName = "超级管理员",
                    CreateDate = DateTime.Now,
                    CreateUserId = 1,
                    CreateUserName = "******",
                    Remark = "超级管理员, 拥有系统所有权限"
                }
            };

            new SysLogService().Add(new Request<SysLog>()
            {
                Obj = new SysLog()
                {
                    CreateDate = DateTime.Now,
                    Location = "Test/RoleService",
                    Action = "TestAdd",
                    Message = QJsonConvert.Serialize(request),
                    Type = "添加",
                    UserId = 1,
                    UserName = "******"
                }
            });

            var response = service.Add(request);

            Assert.AreEqual(response.Status, 0);

        }
Пример #2
0
        public void TestAdd()
        {
            var request = new Request<Button>()
            {
                Obj = new Button()
                {
                    Name = "新增",
                    Value = "add",
                    Icon = "icon-add",
                    CreateDate = DateTime.Now,
                    CreateUserId = 1,
                    CreateUserName = "******",
                    Remark = ""
                }
            };

            new SysLogService().Add(new Request<SysLog>()
            {
                Obj = new SysLog()
                {
                    CreateDate = DateTime.Now,
                    Location = "Test/ButtonService",
                    Action = "TestAdd",
                    Message = QJsonConvert.Serialize(request),
                    Type = "添加",
                    UserId = 1,
                    UserName = "******"
                }
            });

            var response = service.Add(request);

            Assert.AreEqual(response.Status, 0);

        }
        public void TestAdd()
        {
            var req = new Request<Application>()
            {
                Obj = new Application()
                {
                    CreateDate = DateTime.Now,
                    Name = "通用权限系统",
                    Code = "GPS",
                    CreateUserId = 1,
                    CreateUserName = "******",
                    Remark = "通用权限系统 ( General Permissions System )"
                }
            };

            var res = service.Add(req);

            Assert.AreEqual(res.Status, 0);

        }
Пример #4
0
        public void TestAdd()
        {
            var request = new Request<Company>()
            {
                Obj = new Company()
                {
                    Category = "",
                    Code = "100",
                    Contact = "Qz",
                    CreateDate = DateTime.Now,
                    CreateUserId = 1,
                    CreateUserName = "******",
                    FullName = "Qz",
                    Manager = "Qz",
                    Nature = "",
                    ParentId = 0,
                    Phone = "15012940312",
                    Remark = "",
                    ShortName = "Qz"
                }
            };

            new SysLogService().Add(new Request<SysLog>()
            {
                Obj = new SysLog()
                {
                    CreateDate = DateTime.Now,
                    Location = "Test/CompanyService",
                    Action = "TestAdd",
                    Message = QJsonConvert.Serialize(request),
                    Type = "添加",
                    UserId = 1,
                    UserName = "******"
                }
            });

            var response = service.Add(request);

            Assert.AreEqual(response.Status, 0);

        }
Пример #5
0
        public void TestAdd()
        {
            var request = new Request<Module>()
            {
                Obj = new Module()
                {
                    Name = "系统管理",
                    ParentId = 0,
                    ApplicationId = 1001,
                    Icon = "sys-manage",
                    IconURL = "",
                    URL = "/GPS/SysManage",
                    CreateDate = DateTime.Now,
                    CreateUserId = 1,
                    CreateUserName = "******",
                    Remark = ""
                }
            };

            new SysLogService().Add(new Request<SysLog>()
            {
                Obj = new SysLog()
                {
                    CreateDate = DateTime.Now,
                    Location = "Test/ModuleService",
                    Action = "TestAdd",
                    Message = QJsonConvert.Serialize(request),
                    Type = "添加",
                    UserId = 1,
                    UserName = "******"
                }
            });

            var response = service.Add(request);

            Assert.AreEqual(response.Status, 0);

        }
Пример #6
0
        public void TestAddRange()
        {
            var request = new Request<List<Button>>()
            {
                Obj = new List<Button>()
                {
                    new Button()
                    {
                        Name = "删除",
                        Value = "remove",
                        Icon = "icon-remove",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "修改",
                        Value = "modify",
                        Icon = "icon-modify",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "编辑",
                        Value = "edit",
                        Icon = "icon-edit",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    }
                    ,
                    new Button()
                    {
                        Name = "刷新",
                        Value = "reload",
                        Icon = "icon-reload",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "保存",
                        Value = "save",
                        Icon = "icon-save",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "查询",
                        Value = "search",
                        Icon = "icon-search",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "导入",
                        Value = "import",
                        Icon = "icon-import",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "导出",
                        Value = "export",
                        Icon = "icon-export",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "打印",
                        Value = "print",
                        Icon = "icon-print",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "复制",
                        Value = "copy",
                        Icon = "icon-copy",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "下载",
                        Value = "download",
                        Icon = "icon-download",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "预览",
                        Value = "preview",
                        Icon = "icon-preview",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "浏览",
                        Value = "browser",
                        Icon = "icon-browser",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "审核",
                        Value = "audit",
                        Icon = "icon-audit",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Button()
                    {
                        Name = "授权",
                        Value = "CC",
                        Icon = "icon-CC",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    }
                }
            };

            new SysLogService().Add(new Request<SysLog>()
            {
                Obj = new SysLog()
                {
                    CreateDate = DateTime.Now,
                    Location = "Test/ButtonService",
                    Action = "TestAddRange",
                    Message = QJsonConvert.Serialize(request),
                    Type = "添加",
                    UserId = 1,
                    UserName = "******"
                }
            });

            var response = service.Add(request);

            Assert.AreEqual(response.Status, 0);

        }
        public void TestAddRange()
        {
            //var request = new Request<List<Permission>>()
            //{
            //    Obj = new List<Permission>()
            //    {
            //        new Permission()
            //        {
            //            Name = "营运总监",
            //            CreateDate = DateTime.Now,
            //            CreateUserId = 1,
            //            CreateUserName = "******",
            //            Remark = ""
            //        },
            //        new Permission()
            //        {
            //            Name = "分行经理",
            //            CreateDate = DateTime.Now,
            //            CreateUserId = 1,
            //            CreateUserName = "******",
            //            Remark = ""
            //        },
            //        new Permission()
            //        {
            //            Name = "置业顾问",
            //            CreateDate = DateTime.Now,
            //            CreateUserId = 1,
            //            CreateUserName = "******",
            //            Remark = ""
            //        },
            //        new Permission()
            //        {
            //            Name = "项目经理",
            //            CreateDate = DateTime.Now,
            //            CreateUserId = 1,
            //            CreateUserName = "******",
            //            Remark = ""
            //        },
            //        new Permission()
            //        {
            //            Name = "技术经理",
            //            CreateDate = DateTime.Now,
            //            CreateUserId = 1,
            //            CreateUserName = "******",
            //            Remark = ""
            //        }
            //    }
            //};

            var request = new Request<List<Permission>>()
            {
                Obj = new List<Permission>()
                {
                    new Permission()
                    {
                        Name = "测试角色",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Permission()
                    {
                        Name = "访客角色",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    }
                }
            };

            new SysLogService().Add(new Request<SysLog>()
            {
                Obj = new SysLog()
                {
                    CreateDate = DateTime.Now,
                    Location = "Test/PermissionService",
                    Action = "TestAddRange",
                    Message = QJsonConvert.Serialize(request),
                    Type = "添加",
                    UserId = 1,
                    UserName = "******"
                }
            });

            var response = service.Add(request);

            Assert.AreEqual(response.Status, 0);

        }
Пример #8
0
        public void TestAddRange()
        {
            var request = new Request<List<Module>>()
            {
                Obj = new List<Module>()
                {
                    new Module()
                    {
                        Name = "系统应用",
                        ParentId = 1,
                        ApplicationId = 1001,
                        Icon = "sys-app",
                        IconURL = "",
                        URL = "/GPS/SysApplication",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Module()
                    {
                        Name = "系统日志",
                        ParentId = 1,
                        ApplicationId = 1001,
                        Icon = "sys-log",
                        IconURL = "",
                        URL = "/GPS/SysLog",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Module()
                    {
                        Name = "数据字典",
                        ParentId = 1,
                        ApplicationId = 1001,
                        Icon = "data-code",
                        IconURL = "",
                        URL = "/GPS/DataCode",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Module()
                    {
                        Name = "数据库管理",
                        ParentId = 1,
                        ApplicationId = 1001,
                        Icon = "db-manage",
                        IconURL = "",
                        URL = "/GPS/DBManager",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Module()
                    {
                        Name = "系统设置",
                        ParentId = 0,
                        ApplicationId = 1001,
                        Icon = "sys-setting",
                        IconURL = "",
                        URL = "/GPS/SysSetting",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Module()
                    {
                        Name = "模块管理",
                        ParentId = 6,
                        ApplicationId = 1001,
                        Icon = "module-manage",
                        IconURL = "",
                        URL = "/GPS/ModuleManage",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Module()
                    {
                        Name = "公司管理",
                        ParentId = 6,
                        ApplicationId = 1001,
                        Icon = "company-manage",
                        IconURL = "",
                        URL = "/GPS/CompanyManage",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Module()
                    {
                        Name = "部门管理",
                        ParentId = 6,
                        ApplicationId = 1001,
                        Icon = "dept-manage",
                        IconURL = "",
                        URL = "/GPS/DeptManage",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Module()
                    {
                        Name = "角色管理",
                        ParentId = 6,
                        ApplicationId = 1001,
                        Icon = "role-manage",
                        IconURL = "",
                        URL = "/GPS/SysSetting",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    },
                    new Module()
                    {
                        Name = "用户管理",
                        ParentId = 6,
                        ApplicationId = 1001,
                        Icon = "user-manage",
                        IconURL = "",
                        URL = "/GPS/UserManager",
                        CreateDate = DateTime.Now,
                        CreateUserId = 1,
                        CreateUserName = "******",
                        Remark = ""
                    }
                }
            };

            new SysLogService().Add(new Request<SysLog>()
            {
                Obj = new SysLog()
                {
                    CreateDate = DateTime.Now,
                    Location = "Test/ModuleService",
                    Action = "TestAddRange",
                    Message = QJsonConvert.Serialize(request),
                    Type = "添加",
                    UserId = 1,
                    UserName = "******"
                }
            });

            var response = service.Add(request);

            Assert.AreEqual(response.Status, 0);

        }