private OrganizationsService CreateService(IEnumerable <Organization> listOfOrganizations)
        {
            RegisterDbContext dbContextMock = CreateTestDbContext(listOfOrganizations);
            var service = new OrganizationsService(dbContextMock);

            return(service);
        }
示例#2
0
 public async Task SubmitForm()
 {
     if (OrganizationsService.OrganizationExists(SelectedOrganization.Id) && ProjectsService.ProjectExists(EpicEntity.ProjectId))
     {
         EpicEntity.Project = await ProjectsService.GetProjectOrNull(EpicEntity.ProjectId);
         await SaveOrganization();
     }
 }
        /// <summary>
        /// Get the <see cref="Organization" /> client.
        /// </summary>
        /// <returns>the new client instance for Organization API</returns>
        public OrganizationsApi GetOrganizationsApi()
        {
            var service = new OrganizationsService((Configuration)_apiClient.Configuration)
            {
                ExceptionFactory = _exceptionFactory
            };

            return(new OrganizationsApi(service));
        }
示例#4
0
        public async Task OrganizationChanged(int id)
        {
            SelectedProject = new Project();
            Entity.Epic     = new Epic();
            Entity.EpicId   = 0;

            SelectedOrganization = await OrganizationsService.GetOrganization(id);

            StateHasChanged();
        }
示例#5
0
        protected override async Task OnInitializedAsync()
        {
            if (!(await UserService.IsUserAdmin()))
            {
                UriHelper.NavigateTo(@"\worklogs");
            }

            Input.IncludeOrganizations = true;
            Input.IncludeDisabled      = true;
            Organizations = await OrganizationsService.GetOrganizations();
            await Refresh();
        }
示例#6
0
        public async Task SelectOrganization(int id)
        {
            SelectedOrganization = await OrganizationsService.GetOrganization(id);

            var input = new GetProjectsInput {
                IncludeOrganizations = true, OrganizationId = id, IncludeDisabled = false
            };

            Projects = await ProjectsService.GetProjects(input);

            StateHasChanged();
        }
示例#7
0
        public async Task LoadOrganizations()
        {
            Organizations = await OrganizationsService.GetOrganizations();

            StateHasChanged();

            var found = Organizations.Find(s => s.Name.Equals("CODE101", StringComparison.InvariantCultureIgnoreCase));

            if (found != null)
            {
                await OrganizationChanged(found.Id);

                StateHasChanged();
            }
        }
示例#8
0
        private async void DeleteInternal(ModalResult modalResult)
        {
            if (!modalResult.Cancelled)
            {
                var isDeleted = await OrganizationsService.DeleteOrganization((int)modalResult.Data);

                if (isDeleted)
                {
                    StateHasChanged();
                    await Refresh();
                }
                else
                {
                    ToastService.ShowToast("Unable to delete! Projects exists on this Organization!", ToastLevel.Error);
                }
            }

            Modal.OnClose -= DeleteInternal;
        }
        protected internal OrganizationsApi(OrganizationsService service)
        {
            Arguments.CheckNotNull(service, nameof(service));

            _service = service;
        }
        public async Task SaveOrganization()
        {
            await OrganizationsService.CreateOrEditOrganization(OrganizationInfo);

            Done();
        }
        public async Task LoadOrganization(int id)
        {
            OrganizationInfo = await OrganizationsService.GetOrganizationForEdit(id);

            StateHasChanged();
        }
示例#12
0
        public async Task LoadOrganizations()
        {
            Organizations = await OrganizationsService.GetOrganizations();

            StateHasChanged();
        }
示例#13
0
 public OrganizationsController(OrganizationsService organizationsService)
 {
     _organizationsService = organizationsService;
 }