private OrganizationsService CreateService(IEnumerable <Organization> listOfOrganizations) { RegisterDbContext dbContextMock = CreateTestDbContext(listOfOrganizations); var service = new OrganizationsService(dbContextMock); return(service); }
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)); }
public async Task OrganizationChanged(int id) { SelectedProject = new Project(); Entity.Epic = new Epic(); Entity.EpicId = 0; SelectedOrganization = await OrganizationsService.GetOrganization(id); StateHasChanged(); }
protected override async Task OnInitializedAsync() { if (!(await UserService.IsUserAdmin())) { UriHelper.NavigateTo(@"\worklogs"); } Input.IncludeOrganizations = true; Input.IncludeDisabled = true; Organizations = await OrganizationsService.GetOrganizations(); await Refresh(); }
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(); }
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(); } }
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(); }
public async Task LoadOrganizations() { Organizations = await OrganizationsService.GetOrganizations(); StateHasChanged(); }
public OrganizationsController(OrganizationsService organizationsService) { _organizationsService = organizationsService; }