Пример #1
0
        public IHttpActionResult UsersSeed()
        {
            AccessRolesServ.SaveRole(new AccessRoleModel()
            {
                Id         = 0,
                Name       = "Admin",
                Desciption = "Test admin role, can do averething",
                Roles      = (AccessRoleType.Admin | AccessRoleType.AccessRoleManager).ToString()
            });

            AccessRolesServ.SaveRole(new AccessRoleModel()
            {
                Id         = 0,
                Name       = "new role",
                Desciption = "Test role",
                Roles      = AccessRoleType.Admin.ToString()
            });

            UserRegServ.CreateSystemUser(new RegisterUserModel()
            {
                Name             = "admin",
                Email            = "*****@*****.**",
                Phone            = "89159998877",
                LastName         = "admin",
                Company          = "none",
                Position         = "none",
                GeneratePassword = false,
                NotSendWelcome   = true,
                Password         = "******",
                RoleId           = 1
            });

            UserRegServ.CreateSystemUser(new RegisterUserModel()
            {
                Name             = "teest",
                Email            = "*****@*****.**",
                Phone            = "89151234455",
                LastName         = "admin",
                Company          = "none",
                Position         = "none",
                GeneratePassword = false,
                NotSendWelcome   = true,
                Password         = "******",
                RoleId           = 2
            });

            UserRegServ.CreateSystemUser(new RegisterUserModel()
            {
                Name             = "deleted",
                Email            = "*****@*****.**",
                Phone            = "89155558822",
                LastName         = "admin",
                Company          = "none",
                Position         = "none",
                GeneratePassword = false,
                NotSendWelcome   = true,
                Password         = "******",
                RoleId           = 2
            });

            UserRegServ.MarkDeleted(UserRep.FindOneByEmail("*****@*****.**").Id);

            return(Ok());
        }
Пример #2
0
 public IHttpActionResult SaveAccessRole([FromBody] AccessRoleModel model)
 {
     return(Ok(RoleServ.SaveRole(model).Response()));
 }