Пример #1
0
 protected void Buttonguar2_Click(object sender, EventArgs e)
 {
     try
     {
         Terceros ter       = (Terceros)Session["tercero"];
         string   ipprivada = GetLocalIPAddress();
         string   ippublica = GetPublicIPAddress();
         terc.tipotercero_idtipotercero = Validar.validarselected(DropDownList1.SelectedValue);
         terc.tipodoc_idtipodoc         = Validar.validarselected(DropDownListtipodocu.SelectedValue);
         terc.nombre         = Validar.validarlleno(TextBox5.Text);
         terc.telefono       = Validar.validarlleno(TextBox6.Text);
         terc.correo         = Validar.validarlleno(TextBox7.Text);
         terc.identificacion = texboxdni.Text;
         if (terc.RegitrarTerceroegreso(terc))
         {
             DataRow datcont = Validar.Consulta(terc.ConsultarPersonaIdenti(texboxdni.Text)).Rows[0];
             eg.observacion            = Validar.validarlleno(TextBox2.Text).ToUpper();
             eg.valoregreso            = Validar.validarlleno(TextBox3.Text);
             eg.motivo_idtercero_egre  = Validar.validarselected(DropDownList2.SelectedValue);
             eg.tercero_idtercero_egre = datcont["idterceros"].ToString();
             eg.tercero_idtercero_reg  = ter.idterceros;
             eg.Registraregreso(ter.identificacion + ": " + ter.nombre + " " + ter.apellido, GetLocalIPAddress() + "-" + Dns.GetHostName() + "-" + GetPublicIPAddress());
             imprimir();
             string guardar = "SI";
             Response.Redirect("pagegresos.aspx?key=" + guardar);
         }
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", " errorsoft();", true);
         }
     }
     catch (Exception ex)
     {
         textError.InnerHtml = ex.Message;
         Alerta.CssClass     = "alert alert-error";
         Alerta.Visible      = true;
     }
 }