Exemplo n.º 1
0
        private void frmMovimientos_Load_1(object sender, EventArgs e)
        {
            orm = new dbaseORM();
            string             query     = "select * from catalogos.movimientos order by tipo_mov;";
            List <movimientos> resultado = orm.queryForList <movimientos>(query);

            foreach (movimientos item in resultado)
            {
                string tipo_mov   = item.tipo_mov;
                string tipo       = item.tipo;
                string movimiento = item.movimiento;
                int    id         = item.id;

                datos.Rows.Add(tipo_mov, tipo, movimiento, id);
            }
        }
Exemplo n.º 2
0
        private void btnP_hipote_Click(object sender, EventArgs e)
        {
            if (exito.Visible)
            {
                globales.MessageBoxExclamation("LA SUPERVIVENCIA YA SE REGISTRO EN EL PERIODO", "AVISO", globales.menuPrincipal);
                return;
            }

            if (string.IsNullOrWhiteSpace(txtNumerobuscar.Text))
            {
                globales.MessageBoxExclamation("Favor de ingresar Jubilado, Pensionado o Pensionista para la firma de supervivencia", "Aviso", globales.menuPrincipal);
                return;
            }

            DialogResult dialogo = globales.MessageBoxQuestion("¿Deseas realizar la firma de supervivencia?", "Aviso", globales.menuPrincipal);

            if (dialogo == DialogResult.No)
            {
                return;
            }

            this.registro = true;

            supervive obj = new supervive();

            obj.jpp           = this.jpp;
            obj.numjpp        = globales.convertInt(txtNum.Text);
            obj.anio          = globales.convertInt(txtSupervive_anio.Text);
            obj.periodo       = txtsupervive_periodo.SelectedIndex + 1;
            obj.tipo          = txtSupervive_supervivencia.SelectedIndex + 1;
            obj.observaciones = txtSupervive_observacion.Text;
            obj.firma         = radio_firma.Checked ? 1 : 2;
            obj.q_captura     = globales.usuario;
            obj.f_captura     = DateTime.Now;
            obj.tomafirma     = globales.usuario;
            obj.fecha         = globales.convertDatetime(txtSuperivive_fecha.Text);

            string queyr = $"select * from nominas_catalogos.maestro where rfc = '{txtRfc.Text}'";

            dbaseORM orm = new dbaseORM();

            List <maestro> lista = orm.queryForList <maestro>(queyr);

            if (lista.Count > 1)
            {
                strMasDos = "";

                List <supervive> supers = new List <supervive>();
                foreach (maestro ma in lista)
                {
                    supervive obj1 = new supervive();
                    obj1.jpp           = ma.jpp;
                    obj1.numjpp        = ma.num;
                    obj1.anio          = globales.convertInt(txtSupervive_anio.Text);
                    obj1.periodo       = txtsupervive_periodo.SelectedIndex + 1;
                    obj1.tipo          = txtSupervive_supervivencia.SelectedIndex + 1;
                    obj1.observaciones = txtSupervive_observacion.Text;
                    obj1.firma         = radio_firma.Checked ? 1 : 2;
                    obj1.q_captura     = globales.usuario;
                    obj1.f_captura     = DateTime.Now;
                    obj1.tomafirma     = globales.usuario;
                    obj1.fecha         = globales.convertDatetime(txtSuperivive_fecha.Text);

                    supers.Add(obj1);

                    if (!(obj1.jpp == this.jpp && obj1.numjpp == globales.convertInt(txtNum.Text)))
                    {
                        strMasDos += $", {obj1.jpp}{obj1.numjpp} ";
                    }
                }

                orm.insertAll <supervive>(supers);

                globales.MessageBoxSuccess("Supervivencia registrada", "Aviso", globales.menuPrincipal);
                no.Visible    = false;
                exito.Visible = true;
                string periodo = string.Empty;
                switch (obj.periodo)
                {
                case 1:
                    periodo = "01 AL 21 DE ENERO";
                    break;

                case 2:
                    periodo = "01 AL 21 DE MAYO";
                    break;

                case 3:
                    periodo = "01 AL 21 DE SEPTIEMBRE";
                    break;

                default:
                    break;
                }
                dtggrid.Rows.Add(txtSupervive_anio.Text, periodo, globales.parseDateTime(obj.fecha));
            }
            else
            {
                if (orm.insert <supervive>(obj))
                {
                    globales.MessageBoxSuccess("Supervivencia registrada", "Aviso", globales.menuPrincipal);
                    no.Visible    = false;
                    exito.Visible = true;
                    string periodo = string.Empty;
                    switch (obj.periodo)
                    {
                    case 1:
                        periodo = "01 AL 21 DE ENERO";
                        break;

                    case 2:
                        periodo = "01 AL 21 DE MAYO";
                        break;

                    case 3:
                        periodo = "01 AL 21 DE SEPTIEMBRE";
                        break;

                    default:
                        break;
                    }
                    dtggrid.Rows.Add(txtSupervive_anio.Text, periodo, globales.parseDateTime(obj.fecha));
                }
            }

            if (string.IsNullOrWhiteSpace(textBox1.Text))
            {
                printDocument2.PrinterSettings.PrinterName = "EPSON TM-T20II Receipt5";
                printDocument3.PrinterSettings.PrinterName = "EPSON TM-T20II Receipt5";
                this.bandera = true;
            }
            else
            {
                printDocument2.PrinterSettings.PrinterName = $@"\\{piobtenida}\EPSON TM-T20II Receipt5";
                printDocument3.PrinterSettings.PrinterName = $@"\\{piobtenida}\EPSON TM-T20II Receipt5";
                this.bandera = true;
            }

            try
            {
                printDocument2.Print();
                printDocument3.Print();


                if (DialogResult.Yes == globales.MessageBoxQuestion("¿Deseas imprimir el sobre de págo?", "Sobre de pago", globales.menuPrincipal))
                {
                    this.button1_Click_2(null, null);
                }
            }
            catch
            {
                return;
            }
        }
Exemplo n.º 3
0
        private void rellenar(Dictionary <string, object> diccinario)
        {
            if (this.InvokeRequired)
            {
                metodoEnviar delegado = new metodoEnviar(rellenar);
                this.Invoke(delegado, new Object[] { diccinario });
            }
            else
            {
                dbaseORM orm = new dbaseORM();
                maestro = orm.getObject <maestro>(diccinario);

                txtNumerobuscar.Text = $"{maestro.jpp}{maestro.num}";
                this.jpp             = maestro.jpp;
                this.num             = Convert.ToString(maestro.num);
                txtNum.Text          = Convert.ToString(maestro.num);
                txtRfc.Text          = maestro.rfc;
                txtNombre.Text       = maestro.nombre;
                txtDireccion.Text    = maestro.domicilio;
                txtCat.Text          = maestro.categ;
                txtTel.Text          = maestro.telefono;
                txtSexo.Text         = maestro.sexo;
                txtEle.Text          = maestro.nomelec;
                txtProyecto.Text     = maestro.proyecto;
                txtFin.Text          = globales.parseDateTime(maestro.fching);
                txtLeyenda.Text      = maestro.leyen;
                txtNCuenta.Text      = maestro.cuentabanc;
                txtBanco.Text        = maestro.banco;
                txtImss.Text         = maestro.imss;
                txtCurp.Text         = maestro.curp;
                txtFirma.Text        = maestro.superviven;
                txtFecha.Text        = globales.parseDateTime(maestro.fsupervive);
                jpp = maestro.jpp;



                string queryhuella = $"select huella  from nominas_catalogos.maestro where jpp = '{maestro.jpp}' AND num = {maestro.num} ";
                List <Dictionary <string, object> > result = globales.consulta(queryhuella);
                string huella = Convert.ToString(result[0]["huella"]);
                this.huella_xml = huella;
                if (!string.IsNullOrWhiteSpace(huella))
                {
                    label25.Visible = true;
                }
                else

                {
                    label25.Visible = false;
                }


                string           query          = $"select * from nominas_catalogos.supervive where jpp = '{maestro.jpp}' AND numjpp = {maestro.num} ORDER BY ANIO ";
                List <supervive> listasupervive = orm.queryForList <supervive>(query);

                dtggrid.Rows.Clear();
                listasupervive.ForEach(datos =>
                {
                    string periodo = string.Empty;
                    switch (datos.periodo)
                    {
                    case 1:
                        periodo = "01 AL 21 DE ENERO";
                        break;

                    case 2:
                        periodo = "01 AL 21 DE MAYO";
                        break;

                    case 3:
                        periodo = "01 AL 21 DE SEPTIEMBRE";
                        break;

                    default:
                        break;
                    }
                    dtggrid.Rows.Add(datos.anio, periodo, globales.parseDateTime(datos.fecha));
                });

                query = $"select * from nominas_catalogos.supervive where jpp = '{maestro.jpp}' AND numjpp = {maestro.num} AND ANIO = {DateTime.Now.Year} AND PERIODO = {txtsupervive_periodo.SelectedIndex + 1}";
                List <Dictionary <string, object> > total = globales.consulta(query);
                if (total.Count != 0)
                {
                    exito.Visible = true;
                    no.Visible    = false;
                }
                else
                {
                    exito.Visible = false;
                    no.Visible    = true;
                }

                if (huellita)
                {
                    btnP_hipote_Click(null, null);
                    huellita = false;
                }


                if (!noimprimir)
                {
                    //  button6_Click(null, null);
                }

                noimprimir = false;
            }
        }
Exemplo n.º 4
0
        private void metodoConsejo()
        {
            string fecha = globales.parseDateTime(globales.convertDatetime(txtxFecha1.Text));

            txtxFecha1.Text = fecha;
            if (string.IsNullOrWhiteSpace(fecha))
            {
                globales.MessageBoxExclamation("Ingresar fecha correcta", "Aviso", globales.menuPrincipal);
                return;
            }

            dbaseORM orm   = new dbaseORM();
            string   query = $"select * from datos.h_solici where f_autorizacion = '{fecha}'";

            List <h_solici> lista = orm.queryForList <h_solici>(query);

            if (lista.Count != 0)
            {
                foreach (h_solici item in lista)
                {
                    string   sec     = item.sec;
                    int      folio   = item.expediente;
                    h_sconsj consejo = new h_sconsj();

                    query   = $"select * from datos.h_sconsj where expediente = {folio} and sec = '{sec}'";
                    consejo = orm.queryForMap <h_sconsj>(query);

                    consejo.proyecto = (item.finalidad == "04" || item.finalidad == "05" || item.finalidad == "06" || item.finalidad == "07") ? "XXXXXXXXXX" : consejo.proyecto;

                    if (sec == "0")
                    {
                        consejo.proyecto  = "CONGRUENTE";
                        consejo.necesida  = "COMPROBADA";
                        consejo.solvencia = "COMPROBADA";
                    }
                    else
                    {
                        consejo.cred_ant  = "COMPROBADO";
                        consejo.avance_o  = "COMPROBADO";
                        consejo.necesida  = "COMPROBADA";
                        consejo.solvencia = "COMPROBADA";
                    }

                    bool actualizacion = false;

                    if (consejo.expediente == 0)
                    {
                        consejo.expediente = folio;
                        consejo.sec        = sec;

                        actualizacion = orm.insert <h_sconsj>(consejo);
                    }
                    else
                    {
                        actualizacion = orm.update <h_sconsj>(consejo);
                    }
                }


                globales.MessageBoxSuccess("Se agregaron datos complementarios P/CONSEJO", "Aviso", globales.menuPrincipal);
            }
            else
            {
                globales.MessageBoxExclamation($"No se encuentran registros con fecha de autorización {txtxFecha1.Text}", "Aviso", globales.menuPrincipal);
            }
        }
Exemplo n.º 5
0
        private void rellenar(Dictionary <string, object> diccinario)
        {
            supervive.Visible = true;
            dbaseORM orm = new dbaseORM();

            maestro = orm.getObject <maestro>(diccinario);

            txtNumerobuscar.Text = $"{maestro.jpp}{maestro.num}";
            this.jpp             = maestro.jpp;
            this.num             = Convert.ToString(maestro.num);
            txtNum.Text          = Convert.ToString(maestro.num);
            txtRfc.Text          = maestro.rfc;
            txtNombre.Text       = maestro.nombre;
            txtDireccion.Text    = maestro.domicilio;
            txtCat.Text          = maestro.categ;
            txtTel.Text          = maestro.telefono;
            txtSexo.Text         = maestro.sexo;
            txtEle.Text          = maestro.nomelec;
            txtProyecto.Text     = maestro.proyecto;
            txtFin.Text          = globales.parseDateTime(maestro.fching);
            txtLeyenda.Text      = maestro.leyen;
            txtNCuenta.Text      = maestro.cuentabanc;
            txtBanco.Text        = maestro.banco;
            txtImss.Text         = maestro.imss;
            txtCurp.Text         = maestro.curp;
            txtFirma.Text        = maestro.superviven;
            txtFecha.Text        = globales.parseDateTime(maestro.fsupervive);

            preview.Visible = true;

            int periodo = 0;

            if (DateTime.Now.Month >= 1 && DateTime.Now.Month < 5)
            {
                periodo           = 1;
                label27.Text      = $"PERIODO 01 A 21 MAYO DEL {DateTime.Now.Year}";
                label27.BackColor = Color.LightBlue;

                label29.Text      = $"PERIODO 01 A 21 SEPTIEMBRE DEL {DateTime.Now.Year}";
                label29.BackColor = Color.LightBlue;

                label26.Text      = "PROXIMOS";
                label26.BackColor = Color.LightBlue;

                label28.Text      = "PROXIMOS";
                label28.BackColor = Color.LightBlue;


                string           query          = $"select * from nominas_catalogos.supervive where jpp = '{maestro.jpp}' AND numjpp = {maestro.num} and anio = {DateTime.Now.Year} and periodo = 1 ORDER BY periodo ";
                List <supervive> listasupervive = orm.queryForList <supervive>(query);
                bool             encontrado     = listasupervive.Any(o => o.periodo == 1);
                if (encontrado)
                {
                    label25.Text      = $"PERIODO 01 A 21 ENERO DEL {DateTime.Now.Year}";
                    label25.BackColor = Color.LightGreen;

                    label24.Text      = "FIRMADO";
                    label24.BackColor = Color.LightGreen;

                    pictureBox5.Visible = true;
                    pictureBox6.Visible = false;
                }
                else
                {
                    label25.Text      = $"PERIODO 01 A 21 ENERO DEL {DateTime.Now.Year}";
                    label25.BackColor = Color.Pink;

                    label24.Text      = "NO FIRMADO";
                    label24.BackColor = Color.Pink;

                    pictureBox5.Visible = false;
                    pictureBox6.Visible = true;
                }
            }
            else if (DateTime.Now.Month >= 5 && DateTime.Now.Month < 9)
            {
                periodo           = 2;
                label29.Text      = $"PERIODO 01 A 21 SEPTIEMBRE DEL {DateTime.Now.Year}";
                label29.BackColor = Color.LightBlue;

                label28.Text      = "PROXIMOS";
                label28.BackColor = Color.LightBlue;


                string           query          = $"select * from nominas_catalogos.supervive where jpp = '{maestro.jpp}' AND numjpp = {maestro.num} and anio = {DateTime.Now.Year} and periodo in (1,2) ORDER BY periodo ";
                List <supervive> listasupervive = orm.queryForList <supervive>(query);

                bool encontrado = listasupervive.Any(o => o.periodo == 1);

                if (encontrado)
                {
                    label25.Text      = $"PERIODO 01 A 21 ENERO DEL {DateTime.Now.Year}";
                    label25.BackColor = Color.LightGreen;

                    label24.Text      = "FIRMADO";
                    label24.BackColor = Color.LightGreen;

                    pictureBox5.Visible = true;
                    pictureBox6.Visible = false;
                }
                else
                {
                    label25.Text      = $"PERIODO 01 A 21 ENERO DEL {DateTime.Now.Year}";
                    label25.BackColor = Color.Pink;

                    label24.Text      = "NO FIRMADO";
                    label24.BackColor = Color.Pink;

                    pictureBox5.Visible = false;
                    pictureBox6.Visible = true;
                }

                encontrado = listasupervive.Any(o => o.periodo == 2);


                if (encontrado)
                {
                    label27.Text      = $"PERIODO 01 A 21 MAYO DEL {DateTime.Now.Year}";
                    label27.BackColor = Color.LightGreen;

                    label26.Text      = "FIRMADO";
                    label26.BackColor = Color.LightGreen;

                    pictureBox7.Visible = true;
                    pictureBox8.Visible = false;
                }
                else
                {
                    label27.Text      = $"PERIODO 01 A 21 MAYO DEL {DateTime.Now.Year}";
                    label27.BackColor = Color.Pink;

                    label26.Text      = "NO FIRMADO";
                    label26.BackColor = Color.Pink;

                    pictureBox7.Visible = false;
                    pictureBox8.Visible = true;
                }
            }
            else
            {
                periodo = 3;


                string           query          = $"select * from nominas_catalogos.supervive where jpp = '{maestro.jpp}' AND numjpp = {maestro.num} and anio = {DateTime.Now.Year} and periodo in (1,2,3) ORDER BY periodo ";
                List <supervive> listasupervive = orm.queryForList <supervive>(query);

                bool encontrado = listasupervive.Any(o => o.periodo == 1);

                if (encontrado)
                {
                    label25.Text      = $"PERIODO 01 A 21 ENERO DEL {DateTime.Now.Year}";
                    label25.BackColor = Color.LightGreen;

                    label24.Text      = "FIRMADO";
                    label24.BackColor = Color.LightGreen;

                    pictureBox5.Visible = true;
                    pictureBox6.Visible = false;
                }
                else
                {
                    label25.Text      = $"PERIODO 01 A 21 ENERO DEL {DateTime.Now.Year}";
                    label25.BackColor = Color.Pink;

                    label24.Text      = "NO FIRMADO";
                    label24.BackColor = Color.Pink;

                    pictureBox5.Visible = false;
                    pictureBox6.Visible = true;
                }

                encontrado = listasupervive.Any(o => o.periodo == 2);


                if (encontrado)
                {
                    label27.Text      = $"PERIODO 01 A 21 MAYO DEL {DateTime.Now.Year}";
                    label27.BackColor = Color.LightGreen;

                    label26.Text      = "FIRMADO";
                    label26.BackColor = Color.LightGreen;

                    pictureBox7.Visible = true;
                    pictureBox8.Visible = false;
                }
                else
                {
                    label27.Text      = $"PERIODO 01 A 21 MAYO DEL {DateTime.Now.Year}";
                    label27.BackColor = Color.Pink;

                    label26.Text      = "NO FIRMADO";
                    label26.BackColor = Color.Pink;

                    pictureBox7.Visible = false;
                    pictureBox8.Visible = true;
                }

                encontrado = listasupervive.Any(o => o.periodo == 3);


                if (encontrado)
                {
                    label29.Text      = $"PERIODO 01 A 21 MAYO DEL {DateTime.Now.Year}";
                    label29.BackColor = Color.LightGreen;

                    label28.Text      = "FIRMADO";
                    label28.BackColor = Color.LightGreen;

                    pictureBox9.Visible  = true;
                    pictureBox10.Visible = false;
                }
                else
                {
                    label29.Text      = $"PERIODO 01 A 21 MAYO DEL {DateTime.Now.Year}";
                    label29.BackColor = Color.Pink;

                    label28.Text      = "NO FIRMADO";
                    label28.BackColor = Color.Pink;

                    pictureBox9.Visible  = false;
                    pictureBox10.Visible = true;
                }
            }


            sacarPanelAnterior(DateTime.Now.Year - 1);
        }
Exemplo n.º 6
0
        public void rellenarConsulta(Dictionary <string, object> datos)
        {
            Cursor = Cursors.WaitCursor;
            dtggrid.Rows.Clear();

            dbaseORM orm = new dbaseORM();

            string  query  = $"select * from catalogos.cuentas where proy = '{datos["secretaria"]}'";
            cuentas cuenta = orm.queryForMap <cuentas>(query);

            string descripcion = cuenta.descripcion;

            if (string.IsNullOrWhiteSpace(descripcion))
            {
                query       = $"select * from catalogos.cuentas where cuenta = '{datos["secretaria"]}'";
                cuenta      = orm.queryForMap <cuentas>(query);
                descripcion = cuenta.descripcion;
            }

            p_edocta estadoCuenta = orm.getObject <p_edocta>(datos);

            this.txtrfc.Text            = estadoCuenta.rfc;
            this.txtnombre.Text         = estadoCuenta.nombre_em;
            this.txtproyecto.Text       = estadoCuenta.proyecto;
            this.txtfolio.Text          = Convert.ToString(estadoCuenta.folio);
            this.txtdirec.Text          = estadoCuenta.direccion;
            this.txtcheque.Text         = globales.parseDateTime(estadoCuenta.f_emischeq);
            this.txtpago.Text           = estadoCuenta.tipo_pago;
            this.txtimporte.Text        = string.Format("{0:C}", estadoCuenta.imp_unit);
            this.txtubicacion.Text      = estadoCuenta.ubic_pagare;
            this.txttotal.Text          = string.Format("{0:C}", estadoCuenta.importe);
            this.txtsecretaria.Text     = estadoCuenta.secretaria + "        " + descripcion;
            this.txtpagocuenta.Text     = globales.parseDateTime(estadoCuenta.f_primdesc);
            this.txtfechasolicitud.Text = globales.parseDateTime(estadoCuenta.f_solicitud);
            this.txtplazo.Text          = Convert.ToString(estadoCuenta.plazo);
            string fecha = Convert.ToString(estadoCuenta.fallecio);

            if (!string.IsNullOrWhiteSpace(fecha))
            {
                checFallecio.Checked = true;
                checFallecio.Visible = true;
                fec_falle.Visible    = true;
                fec_falle.Text       = fecha;
            }
            else
            {
                checFallecio.Checked = false;
                fec_falle.Visible    = false;
            }
            secretaria = estadoCuenta.secretaria;

            //el código para llenar el dagrid...
            string aux = Convert.ToString(datos["folio"]);

            query = string.Format("select hum,f_descuento,numdesc,totdesc,importe,rfc,cuenta,proyecto,tipo_rel,id from datos.descuentos where  folio = {0} AND t_prestamo='Q'  order by f_descuento asc, numdesc asc", aux);
            List <descuentos> descuentos = orm.queryForList <descuentos>(query);

            descuentos.ForEach(o => {
                dtggrid.Rows.Add(globales.parseDateTime(o.f_descuento), o.numdesc, o.totdesc, string.Format("{0:C}", o.importe).Replace("$", ""), o.rfc, o.cuenta, o.proyecto, o.tipo_rel, o.id, o.fum);
            });


            string nombreAux = txtnombre.Text;

            nombreAux = (nombreAux.Contains("(")) ? nombreAux.Substring(0, nombreAux.IndexOf("(")) : nombreAux;

            this.parecidos      = orm.query($"select * from datos.p_edocta where nombre_em like '{nombreAux}%' and historial_pagado is null");
            this.contadorGlobal = 0;
            foreach (Dictionary <string, object> item in this.parecidos)
            {
                if (Convert.ToString(item["folio"]) == txtfolio.Text)
                {
                    break;
                }
                contadorGlobal++;
            }

            checarbotones();


            if (!globales.boolConsulta)
            {
                txtimporte.Cursor      = Cursors.IBeam;
                txtimporte.ReadOnly    = false;
                txtubicacion.Cursor    = Cursors.IBeam;
                txtubicacion.ReadOnly  = false;
                txtplazo.Cursor        = Cursors.IBeam;
                txtplazo.ReadOnly      = false;
                txtcheque.Cursor       = Cursors.IBeam;
                txtcheque.ReadOnly     = false;
                txttotal.Cursor        = Cursors.IBeam;
                txttotal.ReadOnly      = false;
                txtpagocuenta.Cursor   = Cursors.IBeam;
                txtpagocuenta.ReadOnly = false;
                txtnombre.Cursor       = Cursors.IBeam;
                txtnombre.ReadOnly     = false;
                checFallecio.Visible   = true;
                // fec_falle.Visible = true;
            }

            foreach (DataGridViewRow item in dtggrid.Rows)
            {
                double importe = string.IsNullOrWhiteSpace(Convert.ToString(item.Cells[3].Value)) ? 0 : Convert.ToDouble(item.Cells[3].Value);
                if (importe < 0)
                {
                    item.Cells[3].Style.BackColor = Color.FromArgb(180, 0, 0);
                    item.Cells[3].Style.ForeColor = Color.White;
                }
            }
            Cursor = Cursors.Default;
        }