示例#1
0
        public IActionResult AddEmployeeGroup([FromBody] EmployeeGroupDto employeeGroup)
        {
            ulong accountId = ulong.Parse(User.Identity.Name, CultureInfo.InvariantCulture);

            employeeGroup.GroupId = _dataAccessService.AddSpEmployeeGroup(accountId, employeeGroup.GroupName);

            return(Ok(employeeGroup));
        }
示例#2
0
        private void SetupServiceProviders(ScenarioDefinition scenarioDefinition, long scenarioSessionId)
        {
            foreach (var scenarioAccount in scenarioDefinition.Setup.Accounts.Where(a => a.AccountType == AccountType.ServiceProvider))
            {
                long accountId = _accountsService.Create(AccountType.ServiceProvider, scenarioAccount.AccountInfo, "qqq", true);
                _dataAccessService.AddScenarionSessionAccount(scenarioSessionId, accountId);
                AccountDescriptor accountDescriptor = _accountsService.Authenticate(accountId, "qqq");
                _executionContextManager.InitializeStateExecutionServices(accountId, accountDescriptor.SecretSpendKey);

                if (scenarioAccount.RelationGroups != null)
                {
                    foreach (var scenarioRelationGroup in scenarioAccount.RelationGroups)
                    {
                        long groupId = _dataAccessService.AddSpEmployeeGroup(accountId, scenarioRelationGroup.GroupName);

                        foreach (var scenarioRelation in scenarioRelationGroup.Relations)
                        {
                            _dataAccessService.AddSpEmployee(accountId, "", scenarioRelation.RootAttribute, groupId);
                        }
                    }
                }
            }
        }
示例#3
0
        public IActionResult AddEmployeeGroup(long accountId, [FromBody] EmployeeGroupDto employeeGroup)
        {
            employeeGroup.GroupId = _dataAccessService.AddSpEmployeeGroup(accountId, employeeGroup.GroupName);

            return(Ok(employeeGroup));
        }