Exemplo n.º 1
0
        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 }));
        }
Exemplo n.º 2
0
 public async Task <TaskDto> PutTask(int id, TaskDto model)
 {
     return(await _calendarTaskApiClient.PutTask(id, model));
 }