Beispiel #1
0
        public void rellenar(Dictionary <string, object> datos)
        {
            limpiaTodosCampos();
            dbaseORM orm = new dbaseORM();
            p_marcha obj = orm.getObject <p_marcha>(datos);

            txtfolio.Text        = Convert.ToString(obj.folio);
            fecha.Text           = globales.parseDateTime(obj.f_recibo);
            txtnumcheq.Text      = obj.n_cheque;
            txtrfc.Text          = obj.rfc;
            txtnombre.Text       = obj.nombre_em;
            txtsueldo.Text       = string.Format("{0:c}", obj.sueldo_base);
            txtdependencia.Text  = obj.depe;
            txtvida.Text         = obj.descripcion;
            txtmuerto.Text       = globales.parseDateTime(obj.f_acaec);
            txtmeses.Text        = Convert.ToString(obj.meses);
            txtsuertudo.Text     = obj.pers_cobro;
            txtparentesco.Text   = obj.parentesco;
            txtfecobro.Text      = globales.parseDateTime(obj.f_cobro);
            txtmonto.Text        = string.Format("{0:C}", obj.monto);
            txtdescuento.Text    = string.Format("{0:C}", obj.descuentos);
            txtconcepto.Text     = obj.concepto_desc;
            txtliquido.Text      = string.Format("{0:c}", obj.liquido);
            txtimporteletra.Text = obj.liq_letra;

            ActiveControl = fecha;
        }
        public void rellenarCampos(Dictionary <string, object> datos)
        {
            dbaseORM orm = new dbaseORM();
            p_edocth obj = orm.getObject <p_edocth>(datos);

            txtFolio.Text       = Convert.ToString(obj.folio);
            txtSecretaria.Text  = obj.secretaria;
            txtRfc.Text         = obj.rfc;
            txtNombre_em.Text   = obj.nombre_em;
            txtTipo_pago.Text   = obj.tipo_pago;
            txtProyecto.Text    = obj.proyecto;
            txtF_primdesc.Text  = globales.parseDateTime(obj.f_primdesc);
            txtPlazo.Text       = Convert.ToString(obj.plazo);
            txtImp_unit.Text    = string.Format("{0:C}", obj.imp_unit);
            txtImporte.Text     = string.Format("{0:C}", obj.importe);
            txtDireccion.Text   = obj.direccion;
            txtF_solicitud.Text = globales.parseDateTime(obj.f_solicitud);
            txtF_emischeq.Text  = globales.parseDateTime(obj.f_emischeq);
            txtUbic_pagare.Text = obj.ubic_pagare;

            txtTipo_mov1.Text = "AN";
            txtTipo_mov1_SelectedIndexChanged(txtTipo_mov1, null);


            ActiveControl = txtSecretaria;
        }
        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;
            }
        }
Beispiel #4
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);
        }
Beispiel #5
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;
        }