Beispiel #1
0
        public async Task <IActionResult> AddSystemRole(TB_EL_System_Role systemRole)
        {
            var checkExistUser = await _systemManagementService.CheckExistUser(systemRole.Account.Trim());

            if (!checkExistUser)
            {
                return(Ok(new { resultAdd = "notexistuser" }));
            }
            var checkDuplicateSystemRole = await _systemManagementService.CheckDuplicateSystemRole(systemRole.Account);

            if (checkDuplicateSystemRole)
            {
                return(Ok(new { resultAdd = "existsystemrole" }));
            }
            _systemManagementService.AddSystemRole(systemRole);
            if (await _systemManagementService.SaveAll())
            {
                return(Ok(new { resultAdd = "true" }));
            }
            else
            {
                return(Ok(new { resultAdd = "false" }));
            }
        }