public DataSet ProcesarBaseNegativa(BaseNegativaBE BE) { DataSet dsResult; try { cmd = db.GetStoredProcCommand("BaseNegativa_Mnt"); cmd.CommandTimeout = 0; db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION); db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO); db.AddInParameter(cmd, "IdBaseNegativa", DbType.String, BE.IdBaseNegativa); db.AddInParameter(cmd, "vApePaterno", DbType.String, BE.vApePaterno); db.AddInParameter(cmd, "vApeMaterno", DbType.String, BE.vApeMaterno); db.AddInParameter(cmd, "vNombre", DbType.String, BE.vNombre); db.AddInParameter(cmd, "IdTipoDocumento_tt", DbType.String, BE.IdTipoDocumento_tt); db.AddInParameter(cmd, "vNroDocumento", DbType.String, BE.vNroDocumento); db.AddInParameter(cmd, "Motivo", DbType.String, BE.Motivo); db.AddInParameter(cmd, "Observacion", DbType.String, BE.Observacion); dsResult = db.ExecuteDataSet(cmd); } catch (Exception ex) { throw new Exception(ex.Message); } return(dsResult); }
private void CargarDatos() { try { DataSet dsCartera = new DataSet(); BaseNegativaBE oEntity = new BaseNegativaBE() { OPCION = 1, USUARIO = General.General.GetCodigoUsuario, IdBaseNegativa = txtIdBaseNegativa.Text, }; dsCartera = new BaseNegativaBL().ProcesarBaseNegativa(oEntity); if (dsCartera.Tables[0].Rows.Count > 0) { txtdtRegistro.Text = Convert.ToDateTime(dsCartera.Tables[0].Rows[0]["dtRegistro"].ToString()).ToString("dd/MM/yyyy"); txtvApePaterno.Text = dsCartera.Tables[0].Rows[0]["vApePaterno"].ToString(); txtvApeMaterno.Text = dsCartera.Tables[0].Rows[0]["vApeMaterno"].ToString(); txtvNombre.Text = dsCartera.Tables[0].Rows[0]["vNombre"].ToString(); cboIdTipoDocumento_tt.SelectedValue = dsCartera.Tables[0].Rows[0]["IdTipoDocumento_tt"].ToString(); txtvNroDocumento.Text = dsCartera.Tables[0].Rows[0]["vNroDocumento"].ToString(); txtMotivo.Text = dsCartera.Tables[0].Rows[0]["Motivo"].ToString(); txtObservacion.Text = dsCartera.Tables[0].Rows[0]["Observacion"].ToString(); } else { MessageBox.Show("Este candidato no existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnEliminar_Click(object sender, EventArgs e) { DialogResult dialogResult = 0; try { if (dgvBaseNegativa.RowCount > 0) { dialogResult = MessageBox.Show("Seguro de eliminar al candidato: " + dgvBaseNegativa.CurrentRow.Cells["vApePaterno"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { BaseNegativaBE oEntity = new BaseNegativaBE() { OPCION = 3, USUARIO = General.General.GetUsuario, IdBaseNegativa = dgvBaseNegativa.CurrentRow.Cells["IdBaseNegativa"].Value.ToString(), }; new BaseNegativaBL().ProcesarBaseNegativa(oEntity); MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); btnBuscar.PerformClick(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public DataSet ProcesarBaseNegativa(BaseNegativaBE BE) { DataSet dsRet = new DataSet(); try { dsRet = BaseNegativaDA.ProcesarBaseNegativa(BE); } catch (Exception ex) { throw new Exception(ex.Message); } return(dsRet); }
private void btnAceptar_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtvApePaterno.Text.Trim())) { MessageBox.Show("Ingresar un apellido paterno", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txtvApePaterno.Focus(); return; } if (string.IsNullOrEmpty(cboIdTipoDocumento_tt.SelectedValue.ToString())) { MessageBox.Show("Se debe seleccionar un tipo de documento", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); cboIdTipoDocumento_tt.Focus(); return; } if (string.IsNullOrEmpty(txtvNroDocumento.Text.Trim())) { MessageBox.Show("Ingresar un número de documento", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txtvNroDocumento.Focus(); return; } BaseNegativaBE oEntity = new BaseNegativaBE() { USUARIO = General.General.GetCodigoUsuario, OPCION = 2, IdBaseNegativa = txtIdBaseNegativa.Text, vApePaterno = txtvApePaterno.Text, vApeMaterno = txtvApeMaterno.Text, vNombre = txtvNombre.Text, IdTipoDocumento_tt = cboIdTipoDocumento_tt.SelectedValue.ToString(), vNroDocumento = txtvNroDocumento.Text, Motivo = txtMotivo.Text, Observacion = txtObservacion.Text }; new BaseNegativaBL().ProcesarBaseNegativa(oEntity); MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnBuscar_Click(object sender, EventArgs e) { try { DataSet ds = new DataSet(); BaseNegativaBE oEntity = new BaseNegativaBE() { OPCION = 1, USUARIO = General.General.GetUsuario, vApePaterno = TextBoxX1.Text.ToString().Trim(), vNroDocumento = txtvNroDocumento.Text, }; ds = new BaseNegativaBL().ProcesarBaseNegativa(oEntity); dgvBaseNegativa.DataSource = ds.Tables[0]; lblRegistros.Text = ds.Tables[0].Rows.Count.ToString() + " registro(s)"; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }