コード例 #1
0
        private void txtCedula_Leave(object sender, EventArgs e)
        {
            if (this.txtCedula.Text.Trim() == "")
            {
                this.txtCedula.Text = "0";
            }

            this.txtProcedencia.Text = new blFallecidos().gmtdBuscarCedula(this.txtCedula.Text);
            if (this.txtProcedencia.Text == "Socio")
            {
                tblSocio socio = new blSocio().gmtdConsultarDetalle(this.txtCedula.Text);
                this.txtSocio.Text     = socio.intCodigoSoc.ToString();
                this.txtNombre.Text    = socio.strNombreSoc;
                this.txtApellido1.Text = socio.strApellido1Soc;
                this.txtApellido2.Text = socio.strApellido2Soc;
                this.dgvAgraciados.AutoGenerateColumns = false;
                this.dgvAgraciados.DataSource          = new blAgraciado().gmtdConsultar(Convert.ToInt32(this.txtSocio.Text));
            }
            else
            {
                if (this.txtProcedencia.Text == "Agraciado")
                {
                    tblAgraciado objAgraciado = new blAgraciado().gmtdConsultarDetalle(this.txtCedula.Text);
                    this.txtSocio.Text     = objAgraciado.intCodigoSoc.ToString();
                    this.txtNombre.Text    = objAgraciado.strNombreAgra;
                    this.txtApellido1.Text = objAgraciado.strApellido1Agra;
                    this.txtApellido2.Text = objAgraciado.strApellido2Agra;
                    this.dgvAgraciados.AutoGenerateColumns = false;
                    this.dgvAgraciados.DataSource          = new blAgraciado().gmtdConsultar(Convert.ToInt32(-1));
                }
            }
        }
コード例 #2
0
        private void btnFiltrar_Click(object sender, EventArgs e)
        {
            blAgraciado blAgra = new blAgraciado();

            this.dgvAgraciados.AutoGenerateColumns = false;
            this.dgvAgraciados.DataSource          = blAgra.gmtdFiltrar(crearObj());
        }
コード例 #3
0
        private void txtCedula_Leave(object sender, EventArgs e)
        {
            tblSocio socio = new blSocio().gmtdConsultarDetalle(this.txtCedula.Text);

            if (socio.strApellido1Soc != null)
            {
                this.txtSocio.Text        = socio.intCodigoSoc.ToString();
                this.txtNombre.Text       = socio.strNombreSoc;
                this.txtApellidoPre1.Text = socio.strApellido1Soc;
                this.txtApellidoPre2.Text = socio.strApellido2Soc;
            }
            else
            {
                tblAgraciado agraciado = new blAgraciado().gmtdConsultar(this.txtCedula.Text);
                if (agraciado.strNombreAgra != null)
                {
                    this.txtSocio.Text        = agraciado.intCodigoSoc.ToString();
                    this.txtNombre.Text       = agraciado.strNombreAgra;
                    this.txtApellidoPre1.Text = agraciado.strApellido1Agra;
                    this.txtApellidoPre2.Text = agraciado.strApellido2Agra;
                }
            }


            this.datosDeudor.AutoGenerateColumns = false;
            this.datosDeudor.DataSource          = new blCreditos().gmtdConsultarCreditosxPersona(this.txtCedula.Text);
        }
コード例 #4
0
 /// <summary>
 /// Carga la grid con datos si tiene permisos necesarios.
 /// </summary>
 private void pmtdCargarGrid()
 {
     if (propiedades.bitConsultar == true)
     {
         blAgraciado blAgra = new blAgraciado();
         this.dgvAgraciados.AutoGenerateColumns = false;
         this.dgvAgraciados.DataSource          = blAgra.gmtdConsultarTodos();
     }
 }
コード例 #5
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            string strRespuesta = new blAgraciado().gmtdEditar(crearObj());

            this.pmtdMensaje(strRespuesta, "Agraciados");
            this.pmtdCargarGrid();
            if (strRespuesta.Substring(0, 1) != "-")
            {
                this.pmtdLimpiarText();
                this.pmtdHabilitarText(true);
            }
        }
コード例 #6
0
        private void txtSocioActual_Leave(object sender, EventArgs e)
        {
            List <Agraciado> agraciado = new blAgraciado().gmtdConsultar(Convert.ToInt32(this.txtSocioActual.Text));

            if (agraciado.Count <= 0)
            {
                MessageBox.Show("El código escrito no tiene agracidos registrados.", "Agraciados", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.btnActualizar.Enabled = false;
            }

            this.cboBeneficiario.DataSource = agraciado;
        }
コード例 #7
0
        private void btnBuscarAgraciados_Click(object sender, EventArgs e)
        {
            List <Agraciado> agraciado = new blAgraciado().gmtdConsultar(Convert.ToInt32(this.txtSocioActual.Text));

            if (agraciado.Count <= 0)
            {
                MessageBox.Show("El código escrito no tiene agracidos registrados.", "Agraciados", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            this.dgvAgraciados.AutoGenerateColumns = false;
            this.dgvAgraciados.DataSource          = agraciado;
        }
コード例 #8
0
        private void txtCedula_Leave(object sender, EventArgs e)
        {
            string strValoraEvaluar = "";

            if (this.cboTipo.SelectedIndex == 1)
            {
                strValoraEvaluar = socio.strCedulaSoc;
            }
            else
            {
                strValoraEvaluar = this.txtCedula.Text;
            }

            if (new blSocio().gmtdConsultarCeduladeSocioAgraciadoFallecido(strValoraEvaluar))
            {
                MessageBox.Show("Este número de cédula ya aparece registrado como socio, agraciado ó fallecido. ", "Socio", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.txtCedula.Text = "0";
                return;
            }

            switch (this.cboTipo.SelectedText)
            {
            case "Agraciado":

                tblAgraciado agraciado = new blAgraciado().gmtdConsultarDetalle(strValoraEvaluar);
                if (agraciado.strNombreAgra != null)
                {
                    this.txtNombre.Text       = agraciado.strNombreAgra + " " + agraciado.strApellido1Agra + " " + agraciado.strApellido2Agra;
                    this.btnHabilitar.Enabled = true;
                }
                else
                {
                    MessageBox.Show("Este agraciado no aparece registrado.", "Agraciado", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.btnHabilitar.Enabled = false;
                }
                break;

            case "Socio":
                socio = new blSocio().gmtdConsultarDetalle(strValoraEvaluar);
                if (socio.strNombreSoc != null)
                {
                    this.txtNombre.Text       = socio.strNombreSoc + " " + socio.strApellido1Soc + " " + socio.strApellido1Soc;
                    this.btnHabilitar.Enabled = true;
                }
                else
                {
                    MessageBox.Show("Este socio no aparece registrado.", "Agraciado", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.btnHabilitar.Enabled = false;
                }
                break;
            }
        }
コード例 #9
0
        private void dgv_DoubleClick(object sender, EventArgs e)
        {
            tblAgraciado agraciado = new tblAgraciado();
            DataGridViewSelectedRowCollection rows = ((DataGridView)sender).SelectedRows;

            foreach (DataGridViewRow dato in rows)
            {
                agraciado = new blAgraciado().gmtdConsultarDetalle(dato.Cells[1].Value.ToString());
            }

            if (agraciado.strNombreAgra != null)
            {
                this.txtCedula.Enabled = false;
                if (agraciado.bitSexo == true)
                {
                    this.cboSexo.SelectedIndex = 0;
                }
                else
                {
                    this.cboSexo.SelectedIndex = 1;
                }

                this.dtpIngreso.Value          = agraciado.dtmFechaIng;
                this.dtpNacimiento.Value       = agraciado.dtmFechaNac;
                this.txtCodigo.Text            = agraciado.intCodigoSoc.ToString();
                this.txtApellido1.Text         = agraciado.strApellido1Agra;
                this.txtApellido2.Text         = agraciado.strApellido2Agra;
                this.txtCedula.Text            = agraciado.strCedulaAgra;
                this.cboBarrios.SelectedValue  = agraciado.strCodBarrio;
                this.cboOficios.SelectedValue  = agraciado.strCodOficio;
                this.txtMail.Text              = agraciado.strCorreo;
                this.txtDireccion.Text         = agraciado.strDireccion;
                this.cboEscolaridad.Text       = agraciado.strEscolaridad;
                this.txtNombre.Text            = agraciado.strNombreAgra;
                this.txtTelefono.Text          = agraciado.strTelefono;
                this.cboTipo.Text              = agraciado.strTipoCed;
                this.cboParentesco.Text        = agraciado.strParentesco;
                this.txtCedula.Enabled         = false;
                this.txtCodigo.Enabled         = false;
                this.txtLugardeExpedicion.Text = agraciado.strLugarExpedicion;
                this.dtmFechaExpedicion.Value  = Convert.ToDateTime(agraciado.dtmFechaExpedicion);
            }
        }
コード例 #10
0
        private void txtCedula_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)13)
            {
                switch (this.cboTipo.SelectedItem.ToString())
                {
                case "Agraciado":
                    tblAgraciado agraciado = new blAgraciado().gmtdConsultarAnulado(this.txtCedula.Text);
                    if (agraciado.strNombreAgra != null && agraciado.bitAnulado)
                    {
                        this.txtNombre.Text       = agraciado.strNombreAgra + " " + agraciado.strApellido1Agra + " " + agraciado.strApellido2Agra;
                        this.btnHabilitar.Enabled = true;
                        this.btnHabilitar.Focus();
                    }
                    else
                    {
                        MessageBox.Show("Este agraciado no aparece registrado.", "Agraciado", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.btnHabilitar.Enabled = false;
                    }
                    break;

                case "Socio":
                    socio = new blSocio().gmtdConsultar(this.txtCedula.Text);
                    if (socio.strNombreSoc != null && socio.bitAnulado)
                    {
                        this.txtNombre.Text       = socio.strNombreSoc + " " + socio.strApellido1Soc + " " + socio.strApellido1Soc;
                        this.btnHabilitar.Enabled = true;
                        this.btnHabilitar.Focus();
                    }
                    else
                    {
                        MessageBox.Show("Este socio no aparece registrado.", "Agraciado", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.btnHabilitar.Enabled = false;
                    }
                    break;
                }
            }
        }