Exemplo n.º 1
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            try
            {
                if (AspectID.Text != "")//actualizar
                {
                    pent.pentagSQL bd = new pent.pentagSQL();
                    bd.updateCatAspect(Elemento.Text, AspectRev.Text, RadioButtonList1.SelectedValue, AspectID.Text, ConnectionString);

                    HiddenField1.Value = "0";
                    Response.Redirect("CatAspects.aspx");
                }
                else
                {//guardar nuevo
                    pent.pentagSQL bd = new pent.pentagSQL();
                    bd.InsertCatCatAspect(Formatos.SelectedValue, Elemento.Text, AspectRev.Text, RadioButtonList1.SelectedValue, ConnectionString);
                    Response.Redirect("CatAspects.aspx");
                }
            }
            catch (Exception ex)
            {
                Response.Write("<script>alert('ocurrio un error contacte con el administrador del sistema');</script>");
            }
        }