Example #1
0
        public DataSet ProcesarSolicitudDocumento(SolicitudDocumentoBE BE)
        {
            DataSet dsRet = new DataSet();

            try
            {
                dsRet = SolicitudDocumentoDA.ProcesarSolicitudDocumento(BE);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsRet);
        }
 private void CargarDatos()
 {
     try
     {
         SolicitudDocumentoBE oEntity = new SolicitudDocumentoBE();
         oEntity.OPCION      = 1;
         oEntity.USUARIO     = General.General.GetUsuario;
         oEntity.IdSolicitud = Codigo;
         DataSet ds = new SolicitudDocumentoBL().ProcesarSolicitudDocumento(oEntity);
         dgvDocumento.DataSource = ds.Tables[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(cboIdDocumento.SelectedValue.ToString()))
                {
                    MessageBox.Show("Debe seleccionar el documento", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (string.IsNullOrEmpty(txtiPlazo.Text.Trim()))
                {
                    MessageBox.Show("Ingresar el plazo", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (string.IsNullOrEmpty(txtnTEA.Text.Trim()))
                {
                    MessageBox.Show("Ingresar la TEA", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                btnAceptar.Enabled = false;
                SolicitudDocumentoBE oEntity = new SolicitudDocumentoBE();
                oEntity.OPCION      = 2;
                oEntity.USUARIO     = General.General.GetUsuario;
                oEntity.IdSolicitud = Codigo;
                oEntity.IdDocumento = cboIdDocumento.SelectedValue.ToString();
                oEntity.iPlazo      = !string.IsNullOrEmpty(txtiPlazo.Text) ? int.Parse(txtiPlazo.Text) : 0;
                oEntity.nTEA        = !string.IsNullOrEmpty(txtnTEA.Text) ? decimal.Parse(txtnTEA.Text) : 0;
                new SolicitudDocumentoBL().ProcesarSolicitudDocumento(oEntity);

                cboIdDocumento.SelectedValue = string.Empty;
                txtiPlazo.Clear();
                txtnTEA.Clear();

                CargarDatos();
                btnAceptar.Enabled = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #4
0
        public DataSet ProcesarSolicitudDocumento(SolicitudDocumentoBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("SolicitudDocumento_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, "IdDocumento", DbType.String, BE.IdDocumento);
                db.AddInParameter(cmd, "iPlazo", DbType.Int32, BE.iPlazo);
                db.AddInParameter(cmd, "nTEA", DbType.Decimal, BE.nTEA);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
        private void dgvDocumento_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                if (e.ColumnIndex < 0)
                {
                    return;
                }
                if (e.RowIndex == -1)
                {
                    return;
                }

                if (dgvDocumento.Columns[e.ColumnIndex].Name.Equals("btnEliminar"))
                {
                    dialogResult = MessageBox.Show("Seguro de eliminar el documento: " + dgvDocumento.CurrentRow.Cells["IdDocumento_Dsc"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dialogResult == DialogResult.Yes)
                    {
                        SolicitudDocumentoBE oEntity = new SolicitudDocumentoBE();
                        oEntity.OPCION      = 3;
                        oEntity.USUARIO     = General.General.GetCodigoUsuario;
                        oEntity.IdSolicitud = Codigo;
                        oEntity.IdDocumento = dgvDocumento.CurrentRow.Cells["IdDocumento"].Value.ToString();
                        new SolicitudDocumentoBL().ProcesarSolicitudDocumento(oEntity);
                        CargarDatos();
                        MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }