Exemplo n.º 1
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     try
     {
         if (NoPregunta.Text != "")//actualizar
         {
             pent.pentagSQL bd = new pent.pentagSQL();
             bd.updateCatBehavior(Nombre.Text, RadioButtonList1.SelectedValue, NoPregunta.Text, ConnectionString);
             HiddenField1.Value = "0";
             Response.Redirect("CatBehavior.aspx");
         }
         else
         {//guardar nuevo
             pent.pentagSQL bd = new pent.pentagSQL();
             bd.InsertCatBehavior(Nombre.Text, RadioButtonList1.SelectedValue, ProcesID.Text, ConnectionString);
             Response.Redirect("CatBehavior.aspx");
         }
     }
     catch (Exception ex)
     {
         Response.Write("<script>alert('ocurrio un error contacte con el administrador del sistema');</script>");
     }
 }