Exemplo n.º 1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            /*  */
            IDataReader dr = EventosBD.ObtenerEventos(ModuloId);

            dataListEventos.DataSource = dr;
            dataListEventos.DataBind();
            dr.Close();
        }
Exemplo n.º 2
0
        void EnlazarDatos()
        {
            IDataReader dr = EventosBD.ObtenerUnEvento(eventoId);

            dr.Read();

            textTitulo.Text      = dr["Titulo"].ToString();
            textDescripcion.Text = dr["Descripcion"].ToString();
            textFecha.Text       = dr["Fecha"].ToString();
            textLugar.Text       = dr["Lugar"].ToString();
            textVencimiento.Text = dr["Fecha_Vencimiento"].ToString();

            dr.Close();
        }
Exemplo n.º 3
0
        private void botonActualiza_Click(object sender, System.EventArgs e)
        {
            string Fecha = textFecha.xDate.Year.ToString() + "-";

            Fecha += textFecha.xDate.Month.ToString() + "-";
            Fecha += textFecha.xDate.Day.ToString();

            string Vencimiento = textVencimiento.xDate.Year.ToString() + "-";

            Vencimiento += textVencimiento.xDate.Month.ToString() + "-";
            Vencimiento += textVencimiento.xDate.Day.ToString();

            if (eventoId == -1)
            {
                EventosBD.CrearEvento(moduloId, textTitulo.Text, textDescripcion.Text, Fecha, textLugar.Text, Vencimiento);
            }
            else
            {
                EventosBD.ActualizarEvento(eventoId, textTitulo.Text, textDescripcion.Text, Fecha, textLugar.Text, Vencimiento);
            }

            Response.Redirect((string)ViewState["UrlAnterior"]);
        }
Exemplo n.º 4
0
 private void botonBorrar_Click(object sender, System.EventArgs e)
 {
     EventosBD.BorrarEvento(eventoId);
     Response.Redirect((string)ViewState["UrlAnterior"]);
 }