Search in sources :

Example 11 with Task

use of de.symeda.sormas.app.backend.task.Task in project SORMAS-Project by hzi-braunschweig.

the class TestEntityCreator method createEventTask.

public static Task createEventTask(Event event, TaskStatus taskStatus, User user) {
    TaskDto taskDto = new TaskDto();
    Task task = new TaskDtoHelper().fillOrCreateFromDto(null, taskDto);
    task.setUuid(DataHelper.createUuid());
    task.setCreationDate(new Date());
    task.setChangeDate(new Date());
    task.setTaskContext(TaskContext.CASE);
    task.setTaskType(TaskType.CASE_INVESTIGATION);
    task.setTaskStatus(taskStatus);
    task.setEvent(event);
    task.setAssigneeUser(user);
    try {
        DatabaseHelper.getTaskDao().saveAndSnapshot(task);
        DatabaseHelper.getTaskDao().accept(task);
    } catch (DaoException e) {
        throw new RuntimeException(e);
    }
    return DatabaseHelper.getTaskDao().queryForIdWithEmbedded(task.getId());
}
Also used : Task(de.symeda.sormas.app.backend.task.Task) TaskDtoHelper(de.symeda.sormas.app.backend.task.TaskDtoHelper) DaoException(de.symeda.sormas.app.backend.common.DaoException) TaskDto(de.symeda.sormas.api.task.TaskDto) Date(java.util.Date)

Example 12 with Task

use of de.symeda.sormas.app.backend.task.Task in project SORMAS-Project by hzi-braunschweig.

the class CaseEditTaskListFragment method onListItemClick.

@Override
public void onListItemClick(View view, int position, Object item) {
    Task task = (Task) item;
    TaskEditActivity.startActivity(getContext(), task.getUuid());
}
Also used : Task(de.symeda.sormas.app.backend.task.Task)

Example 13 with Task

use of de.symeda.sormas.app.backend.task.Task in project SORMAS-Project by hzi-braunschweig.

the class ContactEditTaskListFragment method onListItemClick.

@Override
public void onListItemClick(View view, int position, Object item) {
    Task task = (Task) item;
    TaskEditActivity.startActivity(getContext(), task.getUuid());
}
Also used : Task(de.symeda.sormas.app.backend.task.Task)

Example 14 with Task

use of de.symeda.sormas.app.backend.task.Task in project SORMAS-Project by hzi-braunschweig.

the class EventEditTaskListFragment method onListItemClick.

@Override
public void onListItemClick(View view, int position, Object item) {
    Task task = (Task) item;
    TaskEditActivity.startActivity(getActivity(), task.getUuid());
}
Also used : Task(de.symeda.sormas.app.backend.task.Task)

Example 15 with Task

use of de.symeda.sormas.app.backend.task.Task in project SORMAS-Project by hzi-braunschweig.

the class EventReadTaskListFragment method onListItemClick.

@Override
public void onListItemClick(View view, int position, Object item) {
    Task task = (Task) item;
    TaskEditActivity.startActivity(getContext(), task.getUuid());
}
Also used : Task(de.symeda.sormas.app.backend.task.Task)

Aggregations

Task (de.symeda.sormas.app.backend.task.Task)23 Case (de.symeda.sormas.app.backend.caze.Case)7 CaseDao (de.symeda.sormas.app.backend.caze.CaseDao)6 TaskDao (de.symeda.sormas.app.backend.task.TaskDao)6 User (de.symeda.sormas.app.backend.user.User)6 Contact (de.symeda.sormas.app.backend.contact.Contact)5 Event (de.symeda.sormas.app.backend.event.Event)4 Community (de.symeda.sormas.app.backend.region.Community)4 District (de.symeda.sormas.app.backend.region.District)4 AsyncTask (android.os.AsyncTask)3 UserRole (de.symeda.sormas.api.user.UserRole)3 SavingAsyncTask (de.symeda.sormas.app.core.async.SavingAsyncTask)3 Date (java.util.Date)3 HashSet (java.util.HashSet)3 Test (org.junit.Test)3 TaskDto (de.symeda.sormas.api.task.TaskDto)2 ValidationException (de.symeda.sormas.api.utils.ValidationException)2 ActivityAsCase (de.symeda.sormas.app.backend.activityascase.ActivityAsCase)2 ClinicalVisit (de.symeda.sormas.app.backend.clinicalcourse.ClinicalVisit)2 DaoException (de.symeda.sormas.app.backend.common.DaoException)2