示例#1
0
        protected async Task HandleValidSubmit()
        {
            await TaskDataService.AddTask(Task);

            await ModalInstance.CloseAsync(ModalResult.Ok(true));

            ToastService.ShowSuccess($"{Task.Title} Added successfully.", "Success");
        }
示例#2
0
        protected async Task HandleValidSubmit()
        {
            if (Task.HRTaskId > 0)
            {
                await TaskDataService.UpdateTask(Task);

                NavigationManager.NavigateTo("/");
            }
            else
            {
                var result = await TaskDataService.AddTask(Task);

                if (result != null)
                {
                    NavigationManager.NavigateTo("/");
                }
                else
                {
                    Message = "An error has occured";
                }
            }
        }
        protected async Task HandleValidSubmit()
        {
            if (Task.HRTaskId > 0)
            {
                await TaskDataService.UpdateTask(Task);

                ToastService.ShowSuccess("Task updated successfully", "SUCCESS");
                NavigationManager.NavigateTo("/tasksoverview/");
            }
            else
            {
                var result = await TaskDataService.AddTask(Task);

                if (result != null)
                {
                    NavigationManager.NavigateTo("/tasksoverview/");
                    ToastService.ShowSuccess("Task added successfully", "SUCCESS");
                }
                else
                {
                    ToastService.ShowError("Error adding Task", "ERROR");
                }
            }
        }