public IActionResult Save(TaskDto model) { UpdateAuditInformation(model); if (!ModelState.IsValid) { GetStateSettings(ViewState.Write); return(PartialView("Edit", model)); } model = model.Id > 0 ? _taskApiClient.PutTask(model.Id, model).Result : _taskApiClient.PostTask(model).Result; if (!string.IsNullOrWhiteSpace(model.ErrorMessage)) { return(PartialView("Edit", model)); } return(Json(new { success = string.IsNullOrWhiteSpace(model.ErrorMessage), message = model.SuccessMessage })); }
public async Task <TaskDto> PostTask(TaskDto model) { return(await _calendarTaskApiClient.PostTask(model)); }