예제 #1
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet   ds        = new DataSet();
                GestionBE GestionBE = new GestionBE()
                {
                    OPCION      = 1,
                    USUARIO     = General.General.GetUsuario,
                    FechaInicio = dtFechaInicio.Value,
                    FechaFin    = dtFechaFin.Value,
                    IdEstado_tt = cboIdEstado_tt.SelectedValue.ToString()
                };
                ds = new GestionBL().ProcesarGestion(GestionBE);
                dgvGestion.DataSource = ds.Tables[0];
                lblRegistros.Text     = ds.Tables[0].Rows.Count.ToString() + " registro(s)";

                DataSet dsDoc = new DataSet();
                GestionBE.OPCION            = 5;
                dsDoc                       = new GestionBL().ProcesarGestion(GestionBE);
                dgvDocumentos.DataSource    = dsDoc.Tables[0];
                lblRegistrosDocumentos.Text = dsDoc.Tables[0].Rows.Count.ToString() + " registro(s)";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtRazonSocial.Text.Trim()))
                {
                    return;
                }

                DataSet   ds        = new DataSet();
                GestionBE GestionBE = new GestionBE()
                {
                    OPCION  = 4,
                    USUARIO = General.General.GetCodigoUsuario,
                    Entidad = txtRazonSocial.Text.Trim()
                };

                ds = new GestionBL().ProcesarGestion(GestionBE);
                dgvSocioCandidato.DataSource = ds.Tables[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #3
0
 private void CargarDatos()
 {
     try
     {
         DataSet   ds        = new DataSet();
         GestionBE GestionBE = new GestionBE()
         {
             OPCION   = 7,
             USUARIO  = General.General.GetUsuario,
             Entidad  = Codigo,
             FechaFin = _FechaFin,
         };
         ds = new GestionBL().ProcesarGestion(GestionBE);
         dgvDocumentos.DataSource = ds.Tables[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #4
0
        public DataSet ProcesarGestion(GestionBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("Gestion_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "IdGestion", DbType.String, BE.IdGestion);
                db.AddInParameter(cmd, "IdGestionAtendida", DbType.String, BE.IdGestionAtendida);
                db.AddInParameter(cmd, "IdEntidad", DbType.String, BE.IdEntidad);
                db.AddInParameter(cmd, "IdAccion_tt", DbType.String, BE.IdAccion_tt);
                db.AddInParameter(cmd, "IdTipoCompromiso_tt", DbType.String, BE.IdTipoCompromiso_tt);
                if (BE.dtFechaCompromiso != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "dtFechaCompromiso", DbType.DateTime, BE.dtFechaCompromiso);
                }
                db.AddInParameter(cmd, "IdMotivo_tt", DbType.String, BE.IdMotivo_tt);
                db.AddInParameter(cmd, "Comentario", DbType.String, BE.Comentario);
                db.AddInParameter(cmd, "FlgSocio", DbType.Int32, BE.FlgSocio);
                db.AddInParameter(cmd, "FlgInteresado", DbType.Int32, BE.FlgInteresado);
                db.AddInParameter(cmd, "IdEstado_tt", DbType.String, BE.IdEstado_tt);
                db.AddInParameter(cmd, "Entidad", DbType.String, BE.Entidad);
                if (BE.FechaInicio != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "FechaInicio", DbType.DateTime, BE.FechaInicio);
                }
                if (BE.FechaFin != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "FechaFin", DbType.DateTime, BE.FechaFin);
                }
                db.AddInParameter(cmd, "UsuarioID", DbType.String, BE.UsuarioID);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
예제 #5
0
 private void dgvDocumentos_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (dgvDocumentos.RowCount > 0)
         {
             DataSet   ds        = new DataSet();
             GestionBE GestionBE = new GestionBE()
             {
                 OPCION      = 6,
                 USUARIO     = General.General.GetUsuario,
                 IdEntidad   = dgvDocumentos.CurrentRow.Cells["IdSocio"].Value.ToString(),
                 FechaInicio = dtFechaInicio.Value,
                 FechaFin    = dtFechaFin.Value,
             };
             ds = new GestionBL().ProcesarGestion(GestionBE);
             dgvGestionSocio.DataSource = ds.Tables[0];
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #6
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtIdEntidad.ToString()))
                {
                    MessageBox.Show("Ingresar un socio o candidato", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtIdEntidad.Focus();
                    return;
                }

                if (rbtnCompromiso.Checked)
                {
                    if (string.IsNullOrEmpty(cboIdAccion_tt.SelectedValue.ToString()))
                    {
                        MessageBox.Show("Seleccionar una acción", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        cboIdAccion_tt.Focus();
                        return;
                    }

                    if (string.IsNullOrEmpty(cboIdTipoCompromiso_tt.SelectedValue.ToString()))
                    {
                        MessageBox.Show("Seleccionar un compromiso", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        cboIdTipoCompromiso_tt.Focus();
                        return;
                    }

                    if (dtFechaCompromiso.Value == DateTime.MinValue)
                    {
                        MessageBox.Show("Ingrese una fecha de compromiso", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        dtFechaCompromiso.Focus();
                        return;
                    }

                    GestionBE oGestionBE = new GestionBE()
                    {
                        OPCION              = 2,
                        USUARIO             = General.General.GetUsuario,
                        IdGestionAtendida   = IdGestionAtendida,
                        IdEntidad           = txtIdEntidad.Text,
                        IdAccion_tt         = cboIdAccion_tt.SelectedValue.ToString(),
                        IdTipoCompromiso_tt = cboIdTipoCompromiso_tt.SelectedValue.ToString(),
                        dtFechaCompromiso   = dtFechaCompromiso.Value,
                        Comentario          = txtComentario.Text.Trim(),
                        FlgSocio            = FlgSocio,
                        FlgInteresado       = 1
                    };
                    new GestionBL().ProcesarGestion(oGestionBE);
                }
                else
                {
                    if (string.IsNullOrEmpty(cboIdMotivo_tt.SelectedValue.ToString()))
                    {
                        MessageBox.Show("Seleccionar un motivo", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        cboIdMotivo_tt.Focus();
                        return;
                    }

                    if (string.IsNullOrEmpty(txtComentarioNI.Text.Trim()))
                    {
                        MessageBox.Show("Seleccionar un motivo", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        txtComentarioNI.Focus();
                        return;
                    }

                    GestionBE oGestionBE = new GestionBE()
                    {
                        OPCION            = 2,
                        USUARIO           = General.General.GetUsuario,
                        IdGestionAtendida = IdGestionAtendida,
                        IdEntidad         = txtIdEntidad.Text,
                        IdMotivo_tt       = cboIdMotivo_tt.SelectedValue.ToString(),
                        Comentario        = txtComentarioNI.Text.Trim(),
                        FlgSocio          = FlgSocio,
                        FlgInteresado     = 0
                    };
                    new GestionBL().ProcesarGestion(oGestionBE);
                }

                MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #7
0
 public DataSet ProcesarGestion(GestionBE BE)
 {
     return(GestionDA.ProcesarGestion(BE));
 }