protected void btnGuardar_Click(object sender, EventArgs e)
        {
            if (validar())
            {
                UControl        c  = new UControl();
                FacadeAspirante fa = new FacadeAspirante(this);
                if (btnGuardar.Text == "GUARDAR")
                {
                    Session["alu_ID"] = fa.InsertAlumno();//inserta y al mismo tiempo recupera el id
                    int id = (int)Session["alu_ID"];
                    fa.InsertAlumCom(id);
                    for (int i = 0; i < 7; i++)//cambia el 3 por el SelectedItem.text del comobox que tengas
                    {
                        fa.InsertDatosFamiliares(llenarDatosFamiliares(i), id);
                    }
                    fa.DeleteDatosFamiliaresR(id);
                    c.RegistrarFormulario(1, id);
                }
                else
                {
                    int id = (int)Session["alu_ID"];
                    fa.DeleteDatosFamiliares(id);
                    for (int i = 0; i < 7; i++)//cambia el 3 por el SelectedItem.text del comobox que tengas
                    {
                        fa.InsertDatosFamiliares(llenarDatosFamiliares(i), id);
                    }
                    fa.LlamarUpdate(id);
                }

                Server.Transfer("formulario_1.aspx", true);
            }
            else
            { //Response.Write("<script>alert('Asegurece de haber seleccionado una opcion de todos las listas desplegables') </script>");
            }
        }
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     if (f.LlamarSelectExiste(1))
     {
         f.LlamarUpdate(1);
         Type   cstype = this.GetType();
         string script = "<script language='javascript'>alert('!!Felicidades!!, Tu información se actualizó correctamente')</script>";
         this.ClientScript.RegisterStartupScript(cstype, Guid.NewGuid().ToString(), script, false);
     }
     else
     {
         f.LlamarInsert(1);
         Type   cstype = this.GetType();
         string script = "<script language='javascript'>alert('!!Felicidades!!, Tu información se guardo correctamente')</script>";
         this.ClientScript.RegisterStartupScript(cstype, Guid.NewGuid().ToString(), script, false);
         c.RegistrarFormulario(2, Convert.ToInt32(Session["alu_ID"]));
     }
     Server.Transfer("formulario_1.aspx", true);
 }
Пример #3
0
        protected void btnSiguiente2_Click(object sender, EventArgs e)
        {
            UControl          control = new UControl();
            FacadeAspiranteSE f       = new FacadeAspiranteSE(this);

            if (f.LlamarSelectExiste(4))
            {
                f.LlamarUpdate(4);
                Type   cstype = this.GetType();
                string script = "<script language='javascript'>alert('!!Felicidades!!, Tu información se acualizó correctamente')</script>";
                this.ClientScript.RegisterStartupScript(cstype, Guid.NewGuid().ToString(), script, false);
            }
            else
            {
                f.LlamarInsert(4);
                control.RegistrarFormulario(5, Convert.ToInt32(Session["alu_ID"]));
                Type   cstype = this.GetType();
                string script = "<script language='javascript'>alert('!!Felicidades!!, Tu información se guardo correctamente')</script>";
                this.ClientScript.RegisterStartupScript(cstype, Guid.NewGuid().ToString(), script, false);
            }
            Server.Transfer("formulario_1.aspx", true);
        }