private async Task SubmitAsync()
        {
            IsLoading = true;

            var content = new MultipartFormDataContent();

            content.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data");

            content.Add(new StringContent(Input.ProjectDocumentID.ToString()), "ProjectDocumentID");
            content.Add(new StringContent(Input.Title), "Title");

            if (File != null)
            {
                content.Add(new StreamContent(File.Data, (int)File.Data.Length), "FormFileProjectDocument", File.Name);
            }

            var result = await _projectsDocumentService.UpdateProjectDocument(content);

            if (!result.IsSuccessStatusCode)
            {
                Console.WriteLine($"IsError: {result.Content}");
            }
            else
            {
                Console.WriteLine($"IsError: {result.Content}");

                await OnAfterSuccessful.InvokeAsync(true);

                IsLoading = false;

                BaseModal.Close();
            }

            IsLoading = false;
        }
Esempio n. 2
0
        private async Task SubmitAsync()
        {
            IsLoading = true;

            Input.MemberUsername = Task.FromResult(await GetListOfContributorAsync()).Result;

            var result = await _projectsServices.InviteMembers(Input);

            if (result.Status.IsError)
            {
                Console.WriteLine($"IsError: {result.Status.Message}");
            }
            else
            {
                if (result.Result.IsSuccessful)
                {
                    await OnAfterSuccessful.InvokeAsync(true);

                    IsLoading = false;

                    BaseModal.Close();
                }
                else
                {
                    Console.WriteLine($"ErrorMessage: {result.Result.ErrorMessage}");
                }
            }
        }
Esempio n. 3
0
        private async void OnSubmitAsync()
        {
            IsLoading = true;

            var result = await _projectsDocumentService.DeleteProjectDocument(new DeleteProjectDocumentRequest()
            {
                ProjectDocumentID = ID
            });

            if (result.Status.IsError)
            {
                Console.WriteLine($"IsError: {result.Status.Message}");
            }
            else
            {
                if (result.Result.IsSuccessful)
                {
                    IsLoading = false;

                    await OnAfterSuccessful.InvokeAsync(true);

                    BaseModal.Close();
                }
                else
                {
                    Console.WriteLine($"ErrorMessage: {result.Result.ErrorMessage}");
                }
            }
        }
        private async Task SubmitAsync()
        {
            IsLoading = true;

            var result = await _projectsServices.UpdateProjectStatus(Input);

            if (result.Status.IsError)
            {
                Console.WriteLine($"IsError: {result.Status.Message}");
            }
            else
            {
                if (result.Result.IsSuccessful)
                {
                    if (Input.NewProjectStatus == ProjectStatus.SubmittedForApproval)
                    {
                        _projectState.SetMessage("danger", "Project is submitted for Approval");
                    }
                    else
                    {
                        _navigationManager.NavigateTo("/projects");
                    }

                    await OnAfterSuccessful.InvokeAsync(true);

                    IsLoading = false;

                    BaseModal.Close();
                }
                else
                {
                    Console.WriteLine($"ErrorMessage: {result.Result.ErrorMessage}");
                }
            }
        }
        private async void OnSubmitAsync()
        {
            IsLoading = true;

            var result = await _externalTransfersService.DeleteExternalTransfer(new DeleteExternalTransferRequest()
            {
                TransactionID = ID
            });

            if (result.Status.IsError)
            {
                Console.WriteLine($"IsError: {result.Status.Message}");
            }
            else
            {
                if (result.Result.IsSuccessful)
                {
                    IsLoading = false;

                    await OnAfterSuccessful.InvokeAsync(true);

                    BaseModal.Close();
                }
                else
                {
                    Console.WriteLine($"ErrorMessage: {result.Result.ErrorMessage}");
                }
            }
        }
        private async void OnSubmitEditInternalTransferAsync()
        {
            StateHasChanged();

            IsLoading = true;

            var result = await _internalTransfersService.UpdateInternalTransfer(Input);

            if (result.Status.IsError)
            {
                System.Console.WriteLine($"IsError: {result.Status.Message}");
            }
            else
            {
                if (result.Result.IsSuccessful)
                {
                    IsLoading = false;

                    await OnAfterSuccessful.InvokeAsync(true);

                    BaseModal.Close();
                }
                else
                {
                    System.Console.WriteLine($"ErrorMessage: {result.Result.ErrorMessage}");
                }
            }
        }
Esempio n. 7
0
 private async void UpdateStateHasChanged()
 {
     await OnAfterSuccessful.InvokeAsync(true);
 }