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