protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            int id = int.Parse(this.GridView1.DataKeys[e.RowIndex].Value.ToString());

            DataSetTableAdapters.Solicitud_ResumenTableAdapter obj = new DataSetTableAdapters.Solicitud_ResumenTableAdapter();
            string updateaprobado = obj.UpdateActuaEstado(id).ToString();
        }
Exemple #2
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Session["id"] = int.Parse(this.GridView1.DataKeys[e.RowIndex].Value.ToString());
            RadioButtonList rbl      = (RadioButtonList)this.GridView1.Rows[e.RowIndex].FindControl("RadioButtonList1");
            string          aprobado = Convert.ToString(rbl.SelectedValue);
            int             id       = Convert.ToInt32(Session["id"]);

            if (aprobado == "Aprobado")
            {
                DataSetTableAdapters.Solicitud_ResumenTableAdapter obj = new DataSetTableAdapters.Solicitud_ResumenTableAdapter();
                obj.UpdateActuaEstado(id).ToString();
                Thread t = new Thread(EjecutarSP);
                t.Start();
                Response.Write("<script>alert('Se aceptó la solicitud. Email Enviado.');</script>");
                Thread.Sleep(1000);
            }
            else if (aprobado == "Rechazado")
            {
                DataSetTableAdapters.Solicitud_mTableAdapter obj = new DataSetTableAdapters.Solicitud_mTableAdapter();
                obj.UpdateActuaRechazado(id).ToString();
                Thread t = new Thread(EjecutarSP2);
                t.Start();
                Response.Write("<script>alert('Se rechazó la solicitud. Email Enviado.');</script>");
                Thread.Sleep(1000);
            }
        }