public ActionResult Edit(LaboratoryViewModel model) { if (ModelState.IsValid) { Laboratory laboratorio = model.ToDomain(); laboratorio.SetUser(Convert.ToInt32(HttpContext.User.Identity.Name)); Response response = services.LaboratoryService.Save(laboratorio); return(Json(new { Msg = response.Message, Erro = response.Error })); } else { return(Json(new { Msg = "CNPJ inválido", Erro = true })); } }