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 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 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(); } }