public ActionResult SaveChecked(ChecklistChecked chlist) { var checkedItem = new CheckedItem(); var item = _itemService.GetCheckListItemById(chlist.ID); if (item == null) { return(JsonResponse.GetJsonResult(JsonResponse.ERROR_RESPONSE, item)); } var user = _userService.GetUserById(chlist.IDUser); if (user == null) { return(JsonResponse.GetJsonResult(JsonResponse.ERROR_RESPONSE, user)); } checkedItem.CheckListItem = item; checkedItem.User = user; _checkedItemService.UpdateCheckedItem(checkedItem); _checkedItemService.SaveCheckedItem(); return(JsonResponse.GetJsonResult(JsonResponse.OK_DATA_RESPONSE, "OK")); }
public ActionResult RemoveChecked(ChecklistChecked chlist) { var item = _checkedItemService.GetCheckedItemById(chlist.ID); if (item == null) { return(JsonResponse.GetJsonResult(JsonResponse.ERROR_RESPONSE, item)); } _checkedItemService.RemoveCheckedItem(item); _checkedItemService.SaveCheckedItem(); return(JsonResponse.GetJsonResult(JsonResponse.OK_DATA_RESPONSE, "OK")); }