public static Result Criar(Status request) { Result response = new Result() { success = true, Message = "Status salva com Sucesso" }; using (KANBANEntities db = new KANBANEntities()) { db.status.Add(new Kanban.status() { descricao = request.descricao }); db.SaveChanges(); } return response; }
public static Result Editar(Status request) { Result response = new Result() { success = true, Message = "Status Salva com Sucesso!" }; try { using (KANBANEntities db = new KANBANEntities()) { Kanban.status editStatus = db.status.FirstOrDefault(x => x.id == request.idStatus); editStatus.descricao = request.descricao; db.SaveChanges(); } } catch (Exception) { response.Message = "Houve erro ao atualizar as informações da Status, contate o suporte técnico."; response.success = false; } return response; }
public ActionResult Editar(Status request) { var response = StatusModel.Editar(request); return Json(response); }
public ActionResult Criar(Status request) { Result response = StatusModel.Criar(request); return Json(response); }