Exemplo n.º 1
0
        private void CargarConfigEmail()
        {
            Crypto      encry = new Crypto();
            CLS_Correos param = new CLS_Correos();

            param.MtdSeleccionar();
            if (param.Exito)
            {
                if (param.Datos.Rows.Count > 0)
                {
                    txtCorreoRemitente.Text      = param.Datos.Rows[0][0].ToString();
                    txtCorreoUser.Text           = param.Datos.Rows[0][1].ToString();
                    txtCorreoPass.Text           = encry.Desencriptar(param.Datos.Rows[0][2].ToString());
                    txtCorreoPuerto.Text         = param.Datos.Rows[0][6].ToString();
                    txtCorreoServerSaliente.Text = param.Datos.Rows[0][3].ToString();
                    txtCorreoServerEntrante.Text = param.Datos.Rows[0][4].ToString();
                    if (Convert.ToBoolean(param.Datos.Rows[0][5].ToString()))
                    {
                        cmbSeguridadSSL.SelectedIndex = 0;
                    }
                    else
                    {
                        cmbSeguridadSSL.SelectedIndex = 1;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void CargarPantallas()
        {
            CLS_Correos sel = new CLS_Correos();

            sel.MtdSeleccionar();
            if (sel.Exito)
            {
                for (int i = 0; i < sel.Datos.Rows.Count; i++)
                {
                    txtRemitente.Text   = sel.Datos.Rows[i]["v_correoremitente"].ToString();
                    txtCorreo.Text      = sel.Datos.Rows[i]["v_correousuario"].ToString();
                    txtContrasenia.Text = sel.Datos.Rows[i]["v_correocontrasenia"].ToString();
                    txtServerS.Text     = sel.Datos.Rows[i]["v_correoservidorsalida"].ToString();
                    txtServerE.Text     = sel.Datos.Rows[i]["v_correoservidorentrada"].ToString();
                    if (sel.Datos.Rows[i]["b_correocifradoSSL"].ToString() == "True")
                    {
                        cbeCifrado.Text = "Si";
                    }
                    else
                    {
                        cbeCifrado.Text = "No";
                        // cbeCifrado.Text = "No";
                    }
                    txtPuerto.Text = sel.Datos.Rows[i]["n_correopuertosalida"].ToString();
                }
                if (sel.Datos.Rows.Count == 0)
                {
                    cbeCifrado.Text = "No";
                }
            }
        }
Exemplo n.º 3
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");
     }
 }