Beispiel #1
0
        protected void EliminarEvento(object sender, GridViewDeleteEventArgs e)
        {
            EventoLN eventoLN = new EventoLN();
            EventoEN eventoEN = new EventoEN();

            eventoEN.IdEvento = Convert.ToInt32(GridEvento.Rows[e.RowIndex].Cells[3].Text);

            if (eventoLN.eliminarEvento(eventoEN.IdEvento) == 1)
            {
                string mensaje = "Eliminacion Exitosa";
                eventoLN.gridEvento(GridEvento);
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "alert('" + mensaje + "');", true);
            }
        }
Beispiel #2
0
        protected void btnAgregar_Click(object sender, EventArgs e)
        {
            if (btnAgregar1.Text == "Agregar")
            {
                EventoLN eventoLN = new EventoLN();
                EventoEN eventoEN = new EventoEN();

                eventoEN.Nombre = txtEvento.Text;
                eventoEN.Año    = DateTime.Now.Year.ToString();


                if (eventoLN.crearEvento(eventoEN) == 1)
                {
                    string mensaje = "Ingreso Exitoso";
                    eventoLN.gridEvento(GridEvento);
                    txtEvento.Text = String.Empty;
                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "alert('" + mensaje + "');", true);
                    ScriptManager.RegisterClientScriptBlock(this, typeof(System.Web.UI.Page), "cerrarModal", "cerrarModal();", true);
                }
            }
            else
            {
                EventoLN eventoLN = new EventoLN();
                EventoEN eventoEN = new EventoEN();

                eventoEN.IdEvento = Convert.ToInt32(txtIdEvento.Text);
                eventoEN.Nombre   = txtEvento.Text;


                if (eventoLN.actualizarEvento(eventoEN) == 1)
                {
                    string mensaje = "Modificación Exitosa";
                    eventoLN.gridEvento(GridEvento);
                    txtIdEvento.Text = String.Empty;
                    txtEvento.Text   = String.Empty;
                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "alert('" + mensaje + "');", true);
                    ScriptManager.RegisterClientScriptBlock(this, typeof(System.Web.UI.Page), "cerrarModal", "cerrarModal();", true);
                }
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            EventoLN eventoLN = new EventoLN();

            eventoLN.gridEvento(GridEvento);
        }