private async Task AddTask() { TaskItem t = new TaskItem(); t.Title = model.Title; t.CreationDate = DateTime.Now; t.Description = model.Description; t.StartDate = model.StartDate; t.EndDate = model.EndDate; t.Status = "Aktiv"; t.UpdateCount = 0; if (selectedPriority == "Ej Prio") { t.Priority = 1; } else if (selectedPriority == "Låg") { t.Priority = 2; } else if (selectedPriority == "Medel") { t.Priority = 3; } else if (selectedPriority == "Hög") { t.Priority = 4; } else if (selectedPriority == "Omedelbar") { t.Priority = 5; } if (selectedConsequence == "Ingen") { t.Consequence = 1; } else if (selectedConsequence == "Låg") { t.Consequence = 2; } else if (selectedConsequence == "Medel") { t.Consequence = 3; } else if (selectedConsequence == "Hög") { t.Consequence = 4; } else if (selectedConsequence == "Dödlig") { t.Consequence = 5; } await TaskServ.CreateTaskProgramme(t, ProgrammeId); TaskList = TaskDb.GetAllTasksByProgrammeId(ProgrammeId); StateHasChanged(); ModalMd = false; }
protected override async Task OnInitializedAsync() { Programme = (await ProgramContext.Get(ProgrammeId)); TaskList = TaskDb.GetAllTasksByProgrammeId(ProgrammeId); model.StartDate = DateTime.Now; model.EndDate = DateTime.Now.AddDays(7); }