private void btnEliminar_Click(object sender, EventArgs e) { DialogResult dialogResult = 0; try { if (dgvRegistro.RowCount > 0) { dialogResult = MessageBox.Show("Seguro de eliminar a la solicitud: " + dgvRegistro.CurrentRow.Cells["IdTipoRegistro_tt_Dsc"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { SolicitudRegistroBE oEntity = new SolicitudRegistroBE(); oEntity.OPCION = 3; oEntity.USUARIO = General.General.GetCodigoUsuario; oEntity.IdSolicitud = Codigo; oEntity.IdTipoRegistro_tt = dgvRegistro.CurrentRow.Cells["IdTipoRegistro_tt"].Value.ToString(); new SolicitudRegistroBL().ProcesarSolicitudRegistro(oEntity); CargarDatos(); MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public DataSet ProcesarSolicitudRegistro(SolicitudRegistroBE BE) { DataSet dsResult; try { cmd = db.GetStoredProcCommand("SolicitudRegistro_Mnt"); cmd.CommandTimeout = 0; db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION); db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO); db.AddInParameter(cmd, "IdSolicitud", DbType.String, BE.IdSolicitud); db.AddInParameter(cmd, "IdTipoRegistro_tt", DbType.String, BE.IdTipoRegistro_tt); db.AddInParameter(cmd, "vTomo", DbType.String, BE.vTomo); db.AddInParameter(cmd, "vFicha", DbType.String, BE.vFicha); db.AddInParameter(cmd, "vPartida", DbType.String, BE.vPartida); if (BE.dtRegistro != DateTime.MinValue) { db.AddInParameter(cmd, "dtRegistro", DbType.DateTime, BE.dtRegistro); } db.AddInParameter(cmd, "vLugar", DbType.String, BE.vLugar); db.AddInParameter(cmd, "vNroPagina", DbType.String, BE.vNroPagina); db.AddInParameter(cmd, "vCC", DbType.String, BE.vCC); db.AddInParameter(cmd, "vEP", DbType.String, BE.vEP); db.AddInParameter(cmd, "vOtro", DbType.String, BE.vOtro); dsResult = db.ExecuteDataSet(cmd); } catch (Exception ex) { throw new Exception(ex.Message); } return(dsResult); }
private void CargarDatos() { try { SolicitudRegistroBE oEntity = new SolicitudRegistroBE(); oEntity.OPCION = 1; oEntity.USUARIO = General.General.GetUsuario; oEntity.IdSolicitud = Codigo; oEntity.IdTipoRegistro_tt = _IdTipoRegistro_tt; DataSet ds = new SolicitudRegistroBL().ProcesarSolicitudRegistro(oEntity); if (ds.Tables[0].Rows.Count > 0) { cboIdTipoRegistro_tt.SelectedValue = ds.Tables[0].Rows[0]["IdTipoRegistro_tt"].ToString(); txtvTomo.Text = ds.Tables[0].Rows[0]["vTomo"].ToString(); txtvFicha.Text = ds.Tables[0].Rows[0]["vFicha"].ToString(); txtvPartida.Text = ds.Tables[0].Rows[0]["vPartida"].ToString(); dtRegistro.Value = DateTime.Parse(ds.Tables[0].Rows[0]["dtRegistro"].ToString()); txtvLugar.Text = ds.Tables[0].Rows[0]["vLugar"].ToString(); txtvNroPagina.Text = ds.Tables[0].Rows[0]["vNroPagina"].ToString(); txtvCC.Text = ds.Tables[0].Rows[0]["vCC"].ToString(); txtvEP.Text = ds.Tables[0].Rows[0]["vEP"].ToString(); txtvOtro.Text = ds.Tables[0].Rows[0]["vOtro"].ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public DataSet ProcesarSolicitudRegistro(SolicitudRegistroBE BE) { DataSet dsRet = new DataSet(); try { dsRet = SolicitudRegistroDA.ProcesarSolicitudRegistro(BE); } catch (Exception ex) { throw new Exception(ex.Message); } return(dsRet); }
private void CargarDatos() { try { SolicitudRegistroBE oEntity = new SolicitudRegistroBE(); oEntity.OPCION = 1; oEntity.USUARIO = General.General.GetUsuario; oEntity.IdSolicitud = Codigo; DataSet ds = new SolicitudRegistroBL().ProcesarSolicitudRegistro(oEntity); dgvRegistro.DataSource = ds.Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnAceptar_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(cboIdTipoRegistro_tt.SelectedValue.ToString())) { MessageBox.Show("Seleccionar el tipo de registro", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (dtRegistro.Value == DateTime.MinValue) { MessageBox.Show("Se debe ingresar una fecha", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } SolicitudRegistroBE oEntity = new SolicitudRegistroBE(); oEntity.OPCION = 2; oEntity.USUARIO = General.General.GetCodigoUsuario; oEntity.IdSolicitud = Codigo; oEntity.IdTipoRegistro_tt = cboIdTipoRegistro_tt.SelectedValue.ToString(); oEntity.vTomo = txtvTomo.Text; oEntity.vFicha = txtvFicha.Text; oEntity.vPartida = txtvPartida.Text; oEntity.dtRegistro = dtRegistro.Value; oEntity.vLugar = txtvLugar.Text; oEntity.vNroPagina = txtvNroPagina.Text; oEntity.vCC = txtvCC.Text; oEntity.vEP = txtvEP.Text.Trim(); oEntity.vOtro = txtvOtro.Text; new SolicitudRegistroBL().ProcesarSolicitudRegistro(oEntity); MessageBox.Show("Se Guardo Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }