Exemplo n.º 1
0
        private void InsertarRegistro()
        {
            CLS_Correos x = new CLS_Correos();

            x.v_correoremitente       = txtRemitente.Text;
            x.v_correousuario         = txtCorreo.Text;
            x.v_correocontrasenia     = txtContrasenia.Text;
            x.v_correoservidorsalida  = txtServerS.Text;
            x.v_correoservidorentrada = txtServerE.Text;
            if (cbeCifrado.Text == "Si")
            {
                x.b_correocifradoSSL = 1;
            }
            else
            {
                x.b_correocifradoSSL = 0;
            }

            x.n_correopuertosalida = Convert.ToInt32(txtPuerto.Text);
            x.MtdInsertar();
            if (x.Exito)
            {
                XtraMessageBox.Show("Se ha Guardado el registro con exito");
            }
            else
            {
                XtraMessageBox.Show(x.Mensaje);
            }
        }
Exemplo n.º 2
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     if (ValidaCampos())
     {
         Crypto      encryp   = new Crypto();
         CLS_Correos GuardarC = new CLS_Correos();
         GuardarC.CorreoRemitente       = txtCorreoRemitente.Text;
         GuardarC.CorreoUsuario         = txtCorreoUser.Text;
         GuardarC.CorreoContrasenia     = encryp.Encriptar(txtCorreoPass.Text);
         GuardarC.CorreoServidorSalida  = txtCorreoServerSaliente.Text;
         GuardarC.CorreoServidorEntrada = txtCorreoServerEntrante.Text;
         if (cmbSeguridadSSL.SelectedIndex == 0)
         {
             GuardarC.CorreoCifradoSSL = 1;
         }
         else
         {
             GuardarC.CorreoCifradoSSL = 0;
         }
         GuardarC.CorreoPuertoSalida = Convert.ToInt32(txtCorreoPuerto.Text);
         GuardarC.MtdSeleccionar();
         if (GuardarC.Exito)
         {
             if (GuardarC.Datos.Rows.Count > 0)
             {
                 GuardarC.MtdModificar();
             }
             else
             {
                 GuardarC.MtdInsertar();
             }
             if (GuardarC.Exito)
             {
                 XtraMessageBox.Show("Se han Guardado los Datos con Exito");
             }
             else
             {
                 XtraMessageBox.Show(GuardarC.Mensaje);
             }
         }
     }
     else
     {
         XtraMessageBox.Show("Faltan Datos x llenar");
     }
 }