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; } } } }
private void btnAgregar_Click(object sender, EventArgs e) { CLS_Correos GuardaC = new CLS_Correos(); GuardaC.CorreoNombre = txtCorreoDestino.Text; GuardaC.MtdSeleccionarEspecifica(); if (GuardaC.Exito) { if (GuardaC.Datos.Rows.Count == 0) { DataRow dr = dt.NewRow(); dr[0] = txtCorreoDestino.Text; dt.Rows.Add(dr); dtgCorreosDestino.DataSource = dt; GuardaC.MtdEliminar(); for (int x = 0; x < dtgValoresCorreosDestino.RowCount; x++) { GuardaC.CorreoNombre = dt.Rows[x][0].ToString();; GuardaC.MtdInsertarCorreoDestino(); } XtraMessageBox.Show("Se han Guardado los Registros con Exito"); txtCorreoDestino.Text = string.Empty; } } else { XtraMessageBox.Show("Este Correo ya Existe en la Lista"); } }
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); } }
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"; } } }
private void dtgCorreosDestino_DoubleClick(object sender, EventArgs e) { DialogResult = XtraMessageBox.Show("¿Desea Eliminar este correo", "Eliminar Correo", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (DialogResult == DialogResult.Yes) { try { foreach (int i in this.dtgValoresCorreosDestino.GetSelectedRows()) { DataRow row = this.dtgValoresCorreosDestino.GetDataRow(i); string vCorreoId = row["IdCorreo"].ToString(); CLS_Correos GuardaC = new CLS_Correos(); GuardaC.IdCorreo = Convert.ToInt32(vCorreoId); GuardaC.MtdEliminar(); if (GuardaC.Exito) { CargarCorreosDestino(); } } } catch (Exception ex) { XtraMessageBox.Show(ex.Message); } } }
private void btnAgregar_Click(object sender, EventArgs e) { CLS_Correos GuardaC = new CLS_Correos(); GuardaC.CorreoNombre = txtCorreoDestino.Text; GuardaC.ReportesId = Convert.ToInt32(cboReportes.EditValue.ToString()); GuardaC.MtdSeleccionarEspecifica(); if (GuardaC.Exito) { if (GuardaC.Datos.Rows.Count == 0) { CLS_Correos GuardaCD = new CLS_Correos(); GuardaCD.CorreoNombre = txtCorreoDestino.Text; GuardaCD.ReportesId = Convert.ToInt32(cboReportes.EditValue.ToString()); GuardaCD.MtdInsertarCorreoDestino(); if (GuardaCD.Exito) { CargarCorreosDestino(); XtraMessageBox.Show("Se ha Agregado el Correo con Exito"); txtCorreoDestino.Text = string.Empty; } else { XtraMessageBox.Show(GuardaCD.Mensaje); } } else { XtraMessageBox.Show("Este Correo ya Existe en la Lista"); } } }
private void CargarCorreosDestino() { CLS_Correos CargaR = new CLS_Correos(); CargaR.MtdSeleccionarCorreosDestino(); if (CargaR.Exito) { if (CargaR.Datos.Rows.Count > 0) { dtgCorreosDestino.DataSource = CargaR.Datos; } } }
private void CargarReportes(int?Valor) { CLS_Correos conReportes = new CLS_Correos(); conReportes.MtdSeleccionarReportes(); if (conReportes.Exito) { cboReportes.Properties.DisplayMember = "ReporteNombre"; cboReportes.Properties.ValueMember = "ReportesId"; cboReportes.EditValue = Valor; cboReportes.Properties.DataSource = conReportes.Datos; } }
private void dtgCorreosDestino_DoubleClick(object sender, EventArgs e) { txtCorreoDestino.Text = dt.Rows[FilaSelect][0].ToString().Trim(); dt.Rows.RemoveAt(FilaSelect); dtgCorreosDestino.DataSource = dt; CLS_Correos GuardaC = new CLS_Correos(); GuardaC.MtdEliminar(); for (int x = 0; x < dtgValoresCorreosDestino.RowCount; x++) { GuardaC.CorreoNombre = dt.Rows[x][0].ToString();; GuardaC.MtdInsertarCorreoDestino(); } }
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"); } }
private void CargarCorreosDestino() { CLS_Correos CargaR = new CLS_Correos(); CargaR.MtdSeleccionarCorreosDestino(); if (CargaR.Exito) { if (CargaR.Datos.Rows.Count > 0) { for (int x = 0; x < CargaR.Datos.Rows.Count; x++) { DataRow dr = dt.NewRow(); dr[0] = CargaR.Datos.Rows[x][0].ToString().Trim(); dt.Rows.Add(dr); } dtgCorreosDestino.DataSource = dt; } } }