/// <summary> /// Delete current list /// </summary> public void DeleteList() { TaskListService.DeleteTaskList(_currentList); _currentList = _lists[0] ?? new UserTaskListModel(); Update(); }
private void UpdateData() { _lists = TaskListService.GetAllTaskLists(); if (_currentList != null) { _currentList = TaskListService.GetTaskList(_currentList.Name); } }
public void CreateList(string listName) { var newList = new UserTaskListModel() { Name = listName }; TaskListService.CreateTaskList(newList); _currentList = newList; Update(); }
public MainPresenter(IMainView view) { _view = view; _lists = TaskListService.GetAllTaskLists(); _view.ShowUserInfo(User.Email, User.FirstName + " " + User.LastName); if (_lists.Count > 0) { _currentList = _lists[0]; } }
public static UserTaskList MapTaskList(UserTaskListModel model) { if (model == null) { return(null); } return(new UserTaskList(MapUserTaskList(model.UserTasks)) { Id = model.Id, Name = model.Name }); }
public void ItemPressed(IMenuItem item) { if (item.TitleFormatted.ToString() == _view.GetStringFromResourceId(Resource.String.newList)) { _view.ShowCreateListDialog(); return; } _currentList = _lists.FirstOrDefault(x => x.Name == item.TitleFormatted.ToString()); if (_currentList == null) { return; } Update(); }
public void ShowTasks(UserTaskListModel list) { if (list == null) { return; } Title = list.Name; if (_taskListAdapter != null) { _taskListAdapter.TaskList = list.UserTasks; _taskListAdapter.NotifyDataSetChanged(); } else { _taskListAdapter = new TaskListAdapter(_taskListView, this, list.UserTasks); _taskListView.SetAdapter(_taskListAdapter); InitAdapterHandlers(); } }
/// <summary> /// Update task list and set current list to that /// </summary> /// <param name="taskList"></param> public void EditTaskList(UserTaskListModel taskList) { TaskListService.UpdateTaskList(taskList); _currentList = taskList; Update(); }
public bool UpdateTaskList(UserTaskListModel list) { return(_repository.UpdateTaskList(Mapper.MapTaskList(list))); }
/// <summary> /// Send request to presenter. Used in popup fragment /// </summary> public void OnConfirmListEdit(UserTaskListModel taskList) { _presenter.EditTaskList(taskList); }
public void ShowEditListDialog(UserTaskListModel model) { var dialog = new TaskListDialogFragment(model); dialog.Show(FragmentManager, "editList"); }
public bool CreateTask(UserTaskListModel list, UserTaskModel model) { return(_repository.CreateTask(Mapper.MapTaskList(list), Mapper.MapUserTask(model))); }
public TaskListDialogFragment(UserTaskListModel model) { _taskList = model; }