public IActionResult UpdateCardModal(int?id) { if (id == null) { return(RedirectToAction("Index")); } var model = _toDoItemService.GetById((int)id); return(PartialView(model)); }
public ActionResult <ToDoItemDTO> PartialUpdateToDoItem(long todoItemId, JsonPatchDocument <ToDoItemDTO> itemPatch) { var toDoItem = _toDoItemService.GetById(todoItemId); itemPatch.ApplyTo(toDoItem); toDoItem.UpdatedBy = (long)HttpContext.Request.HttpContext.Items["Userid"]; _toDoItemService.UpdateToDoItem(toDoItem); return(StatusCode((int)HttpStatusCode.OK, toDoItem)); }
private void LoadItems() { if (dgvListItem.RowCount > 0) { var sourceItem = _toDoItemService.GetById(int.Parse(dgvListItem.CurrentRow.Cells[0].Value.ToString())); dgwKanban1.DataSource = sourceItem.Select(p => new ToDoItemListView() { Name = p.Name, Description = p.Description, Deadline = p.Deadline, Status = p.Status, Id = p.Id, ToDoListId = p.ToDoListId }).ToList(); // ToDoListId = Convert.ToInt32(sourceItem.Select(x => x.ToDoListId)); } //dgwKanban1.DataSource = _toDoItemService.GetById(int.Parse(dgwKanban1.CurrentRow.Cells[1].Value.ToString())); }
public async Task <IActionResult> GetById(Guid itemId) { var item = await _itemService.GetById(itemId); return(Json(item)); }