//CONSTRUCTOR public Evento(string nombre, TiposEventos tipoEvento, string fecha, string horario, string horarioFin, string direccion, Clientes clienteEvento) { this.nombreEvento = nombre; this.tipoEvento = tipoEvento; this.fechaEvento = fecha; this.horarioEvento = horario; this.horarioEventoF = horarioFin; this.direccionEvento = direccion; this.clienteEvento = clienteEvento; }
public void getAttr() { string query = "SELECT nombre, idTipoEvento, fecha, horario, direccion, idCliente FROM Eventos WHERE idEvento = " + idEvento; DataTable tabla = DBHelper.ConsultarSQL(query); NombreEvento = tabla.Rows[0]["nombre"].ToString(); TipoEvento = new TiposEventos((int)tabla.Rows[0]["idTipoEvento"]); FechaEvento = tabla.Rows[0]["fecha"].ToString(); HorarioEvento = tabla.Rows[0]["horario"].ToString(); DireccionEvento = tabla.Rows[0]["direccion"].ToString(); ClienteEvento = new Clientes((int)tabla.Rows[0]["idCliente"]); }
public void CambiarTipoEvento(TiposEventos newTipoEvento) { try { string query = "UPDATE Evento SET idTipoEvento = '" + newTipoEvento.IdTipoEvento + "' WHERE idEvento = '" + this.IdEvento; DBHelper.ConsultarSQL(query); this.TipoEvento = newTipoEvento; } catch (Exception ex) { MessageBox.Show(ex.Data.ToString(), "Error al cambiar el tipo de evento", MessageBoxButtons.OK, MessageBoxIcon.Error); } }