public int ChangePosition(string json) { int update = 0; var msg = ser.Deserialize <List <JsonObj> >(json); for (int i = 0; i < msg.Count; i++) { var item = TaskListService.Get(msg[i].list); for (int j = 0; j < msg[i].cards.Length; j++) { var card = CardService.Get(msg[i].cards[j]); if (item.Cards.Contains(card)) { if (item.Cards[j].Position != j) { item.Cards[j].Position = j; update = CardService.Update(item.Cards[j]); } } else { card.TaskListId = item.Id; card.Position = j; update = CardService.Update(card); } } } return(update); }
public int Delete(int listId) { var map = mapper.CreateMapper(); TaskListDTO taskList = TaskListService.Get(listId); int i = TaskListService.Delete(taskList); return(i); }
public int Create(string name, int id, string description) { var map = mapper.CreateMapper(); TaskListDTO taskList = TaskListService.Get(id); CardDTO card = new CardDTO { Name = name, TaskListId = taskList.Id, Description = description }; int i = card.Id = CardService.Create(card); return(i); }
public IEnumerable <TaskList> Get() { return(_taskListService.Get()); }