Ejemplo n.º 1
0
        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.CreateTaskCourse(t, CourseId);

            TaskList = TaskDb.GetAllTasksByCourseId(CourseId);
            StateHasChanged();
            ModalMd = false;
        }
Ejemplo n.º 2
0
 protected override async Task OnInitializedAsync()
 {
     Course          = (await CourseContext.Get(CourseId));
     TaskList        = TaskDb.GetAllTasksByCourseId(CourseId);
     model.StartDate = DateTime.Now;
     model.EndDate   = DateTime.Now.AddDays(7);
 }