Example #1
0
        public void Listar_dedicacion()
        {
            clsCRUCDedicacion cls = new clsCRUCDedicacion();

            GridViewListar_Dedicacion.DataSource = cls.listarDedicacion();
            GridViewListar_Dedicacion.DataBind();
        }
Example #2
0
        protected void GridViewListar_Dedicacion_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow r           = GridViewListar_Dedicacion.Rows[e.RowIndex];
            Label       codi        = (r.FindControl("lblcodigo") as Label);
            TextBox     descripcion = (r.FindControl("txtDescripcion") as TextBox);

            string _codi        = Convert.ToString(codi.Text).ToString();
            int    nuevoCodi    = int.Parse(_codi);
            string _descripcion = Convert.ToString(descripcion.Text);


            clsCRUCDedicacion c = new clsCRUCDedicacion();

            c.update_Dedicacion(_descripcion, nuevoCodi);

            GridViewListar_Dedicacion.EditIndex = -1;
            this.Listar_dedicacion();
        }
Example #3
0
        protected void GridViewListar_Dedicacion_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            GridViewRow r      = GridViewListar_Dedicacion.Rows[e.RowIndex];
            Label       codi   = (r.FindControl("lblcodigo") as Label);
            Label       estado = (r.FindControl("lblestado") as Label);

            if (Convert.ToString(estado.Text).ToString() == "Administrativo")
            {
                clsCRUCDedicacion cl = new clsCRUCDedicacion();
                cl.update_Dedicacion_estado(2, Convert.ToInt32(codi.Text));
            }
            else if (Convert.ToString(estado.Text).ToString() == "Docente")
            {
                clsCRUCDedicacion cl = new clsCRUCDedicacion();
                cl.update_Dedicacion_estado(1, Convert.ToInt32(codi.Text));
            }

            GridViewListar_Dedicacion.EditIndex = -1;
            this.Listar_dedicacion();
        }
Example #4
0
        protected void btnAgregarDedi_Click(object sender, EventArgs e)
        {
            try
            {
                string descripcion = txtDesc_Dedicacion.Text.Trim();
                string estado      = DropDownListEstado.SelectedValue.ToString();

                clsCRUCDedicacion cl = new clsCRUCDedicacion();
                if (descripcion != "")
                {
                    cl.insert_dedicacion(descripcion, estado);

                    txtDesc_Dedicacion.Text = "";
                    Listar_dedicacion();
                }
                else
                {
                }
            }
            catch (Exception ex) { ex.Message.ToString(); }
        }