public ActionResult DeleteConfirmed(string id) { participante participante = pnParticipantes.Procurar(id); pnParticipantes.Excluir(id); return(RedirectToAction("Index")); }
public frm_EditarParticipante() { InitializeComponent(); oServiceClient = new ParticipantesWebServiceClient(); oParticipante = new participante(); fechaActual = DateTime.Now; }
// POST: api/participante public string Post([FromBody] participante part) { using (desafioProgEntities bd = new desafioProgEntities()) { bd.participante.Add(part); bd.SaveChanges(); return("Participante salvo com sucesso"); } }
// PUT: api/participante/5 public string Put(int id, [FromBody] participante part) { using (desafioProgEntities bd = new desafioProgEntities()) { participante partAlterar = bd.participante.Find(id); partAlterar.salaEtapa1 = part.salaEtapa1; partAlterar.salaEtapa2 = part.salaEtapa2; bd.SaveChanges(); return("Alterado com sucesso"); } }
public ActionResult Create([Bind(Include = "login,id_evento,Presenca")] participante participante) { if (ModelState.IsValid) { pnParticipantes.Cadastrar(participante); return(RedirectToAction("Index")); } ViewBag.id_evento = new SelectList(pnEventos.PegarDB(), "Id", "Nome", participante.id_evento); ViewBag.login = new SelectList(pnEventos.PegarDB(), "login", "Nome", participante.login); return(View(participante)); }
public static void Cadastrar(participante part) { try { EventosEntities db = new EventosEntities(); db.participante.Add(part); db.SaveChanges(); } catch (Exception) { throw; } }
// GET: participantes/Details/5 public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } participante participante = pnParticipantes.Procurar(id); if (participante == null) { return(HttpNotFound()); } return(View(participante)); }
public Boolean EditarParticipante(participante oParticipante) { try { if (oParticipante != null) { oModelContainer.participantes.AddOrUpdate(oParticipante); oModelContainer.SaveChanges(); estado = true; } } catch (Exception e) { MessageBox.Show(e.Message.ToString()); } return(estado); }
public Boolean EliminarParticipante(participante oParticipante) { try { if (oParticipante != null) { var elimParti = (from p in oModelContainer.participantes where p.id == oParticipante.id select p).FirstOrDefault(); if (elimParti != null) { oModelContainer.participantes.Remove(elimParti); oModelContainer.SaveChanges(); estado = true; } } } catch (Exception e) { MessageBox.Show(e.Message.ToString()); } return(estado); }
public bool EliminarParticipante(participante oParticipante) { return(partis.EliminarParticipante(oParticipante)); }
public bool EditarParticipante(participante oParticipante) { return(partis.EditarParticipante(oParticipante)); }
public bool InsertarParticipante(participante oParticipante) { return(partis.InsertarParticipante(oParticipante)); }
public frm_Participante() { InitializeComponent(); oServiceClient = new ParticipantesWebServiceClient(); oParticipante = new participante(); }