Ejemplo n.º 1
0
        private void rellenarEmpleado(Dictionary <string, object> datos)
        {
            limpiacamposEmpleado();
            empleados obj = new dbaseORM().getObject <empleados>(datos);

            txtRfc.Text       = obj.rfc;
            txtNombre_em.Text = obj.nombre_em;
            txtsexo.Text      = obj.sexo;
            txtDireccion.Text = obj.direccion;
            //   txtSecretaria.Text = obj.proyecto;
            txtCve_categ.Text  = obj.cve_categ;
            txtTipo_rel.Text   = obj.tipo_rel;
            txtSueldobase.Text = globales.convertMoneda(obj.sueldo_base);
            txtProyecto.Text   = (obj.proyecto.Length >= 12) ? obj.proyecto.Substring(0, 12): obj.proyecto;
            txtNomina.Text     = obj.modalidad.Replace("MMYS", "MMS");

            if (!string.IsNullOrWhiteSpace(txtCve_categ.Text))
            {
                string query = $"SELECT * FROM catalogos.categorias where ccatcve='{txtCve_categ.Text.Trim()}'";
                List <Dictionary <string, object> > resul = globales.consulta(query);
                if (resul.Count != 0)
                {
                    txtCcatdes.Text = Convert.ToString(resul[0]["ccatdes"]);
                }
            }
            txtDireccion.Select();
            button1.Enabled = true;
            button3.Enabled = true;

            verificaCreditosAnteriores();
        }
Ejemplo n.º 2
0
        private bool guardarNotifi()
        {
            h_snotif obj = new h_snotif();

            obj.expediente = globales.convertInt(txtExpediente.Text);
            obj.sec        = Convert.ToString(this.secuencia);

            obj.f_notif = globales.convertDatetime(txtF_Notif.Text);
            obj.n_notif = txtN_Notif.Text;
            obj.c_notif = txtC_Notif.Text;
            obj.numemis = txtNumemis.Text;
            obj.t_notif = txtT_Notif.Text;

            dbaseORM orm   = new dbaseORM();
            string   query = $"select expediente from datos.h_snotif where expediente = {txtExpediente.Text} and sec = '{this.secuencia}'";
            List <Dictionary <string, object> > resultado = orm.query(query);

            bool actualizando;

            if (resultado.Count == 0)
            {
                actualizando = orm.insert <h_snotif>(obj);
            }
            else
            {
                actualizando = orm.update <h_snotif>(obj);
            }

            return(actualizando);
        }
Ejemplo n.º 3
0
        private bool guardaPagare()
        {
            h_spagar obj = new h_spagar();

            obj.expediente = globales.convertInt(txtExpediente.Text);
            obj.sec        = Convert.ToString(this.secuencia);
            obj.f_pagare   = globales.convertDatetime(txtF_Pagare.Text);
            obj.f_primdesc = globales.convertDatetime(txtF_Primdesc.Text);

            dbaseORM orm = new dbaseORM();

            string query = $"select expediente from datos.h_spagar where expediente = {txtExpediente.Text} and sec = '{this.secuencia}'";
            List <Dictionary <string, object> > resultado = orm.query(query);

            bool boolResultado;

            if (resultado.Count == 0)
            {
                boolResultado = orm.insert <h_spagar>(obj);
            }
            else
            {
                boolResultado = orm.update <h_spagar>(obj);
            }

            return(boolResultado);
        }
Ejemplo n.º 4
0
        private void guardarHipote(object sender, EventArgs e)
        {
            DialogResult dialogo = globales.MessageBoxQuestion("¿Deseas actualizar el registro?", "Aviso", globales.menuPrincipal);

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

            p_hipote p = new dbaseORM().queryForMap <p_hipote>("select * from datos.p_hipote where folio = " + txtExpediente.Text);

            p.folio       = globales.convertInt(this.txtExpediente.Text);
            p.rfc         = this.ventanaPrincipal.txtRfc.Text;
            p.nombre_em   = this.ventanaPrincipal.txtNombre_em.Text;
            p.tel_ofici   = this.ventanaPrincipal.txtTel_ofic.Text;
            p.direccion   = this.ventanaPrincipal.txtDireccion.Text;
            p.secretaria  = this.ventanaPrincipal.txtSecretaria.Text;
            p.descripcion = this.ventanaPrincipal.txtDescripcion.Text;
            p.direc_inmu  = this.ventanaPrincipal.txtDirec_inmueb.Text;

            dbaseORM orm       = new dbaseORM();
            bool     resultado = orm.update(p);

            if (resultado)
            {
                globales.MessageBoxSuccess("Registro actualizado correctamente", "Aviso", globales.menuPrincipal);
            }
        }
Ejemplo n.º 5
0
        private bool guardarNegativo()
        {
            h_simpro obj = new h_simpro();

            obj.expediente = globales.convertInt(txtExpediente.Text);
            obj.sec        = Convert.ToString(this.secuencia);
            obj.f_noproc   = globales.convertDatetime(txtF_Noproc.Text);
            obj.t_noproc   = txtT_Noproc.Text;

            dbaseORM orm = new dbaseORM();

            string query = $"select * from datos.h_simpro where expediente = {txtExpediente.Text} and sec = '{this.secuencia}'";
            List <Dictionary <string, object> > resultado = orm.query(query);
            bool actualizado;

            if (resultado.Count == 0)
            {
                actualizado = orm.insert <h_simpro>(obj);
            }
            else
            {
                actualizado = orm.update <h_simpro>(obj);
            }

            return(actualizado);
        }
Ejemplo n.º 6
0
        private bool guardaConvenio()
        {
            h_sconsj obj = new h_sconsj();

            obj.expediente = globales.convertInt(txtExpediente.Text);
            obj.sec        = Convert.ToString(this.secuencia);

            obj.proyecto = txtProyecto.Text;
            obj.cred_ant = txtCred_Ant.Text;
            obj.avance_o = txtAvance_o.Text;

            obj.necesida    = txtNececidad.Text;
            obj.solvencia   = txtSolvencia.Text;
            obj.observacion = txtObvervaciones.Text;

            dbaseORM orm   = new dbaseORM();
            string   query = $"select expediente from datos.h_sconsj where expediente = {txtExpediente.Text} and sec = '{this.secuencia}'";
            List <Dictionary <string, object> > resultado = orm.query(query);

            bool boolResultado;

            if (resultado.Count == 0)
            {
                boolResultado = orm.insert <h_sconsj>(obj);
            }
            else
            {
                boolResultado = orm.update <h_sconsj>(obj);
            }

            return(boolResultado);
        }
Ejemplo n.º 7
0
        private bool guardaEnotar()
        {
            h_enotar obj = new h_enotar();

            obj.expediente = Convert.ToInt32(txtExpediente.Text);
            obj.n_notario  = globales.convertInt(txtN_Notario.Text);
            obj.nombre_not = txtNombre_Not.Text;
            obj.n_acta_n   = globales.convertDouble(txtNActa_N.Text);
            obj.n_volu_n   = globales.convertDouble(txtN_Volu_N.Text);
            obj.f_inscr_n  = globales.convertDatetime(txtF_Inscr_N.Text);

            dbaseORM orm = new dbaseORM();

            string query = $"select expediente from datos.h_enotar where expediente = {txtExpediente.Text}";
            List <Dictionary <string, object> > resultado = orm.query(query);

            bool boolResultado;

            if (resultado.Count == 0)
            {
                boolResultado = orm.insert <h_enotar>(obj);
            }
            else
            {
                boolResultado = orm.update <h_enotar>(obj);
            }

            return(boolResultado);
        }
Ejemplo n.º 8
0
        private void textBox7_TextChanged(object sender, EventArgs e)
        {
            string cuentaPunto = txtMayor.Text;

            if (cuentaPunto.Length < 3)
            {
                return;
            }
            int    c;
            int    largo  = cuentaPunto.Length;
            string cadena = string.Empty;
            string pos    = string.Empty;

            for (c = 0; c <= 2; c++)
            {
                if (c == 0 || c == 2)
                {
                    pos = ".";
                }
                if (c == 1)
                {
                    pos = pos + cuentaPunto.Substring(0, 3);
                }
            }



            dtggrid.Rows.Clear();
            List <cuentas> obj = new dbaseORM().queryForList <SISPE_MIGRACION.codigo.repositorios.financieros.cuentas>($"SELECT	* FROM cg_fondos.cuentas WHERE (cuenta LIKE '{txtfolio.Text}%' OR descripcion LIKE '%{txtfolio.Text}%') AND CHAR_LENGTH (cuenta) >= 10 AND cuenta SIMILAR to '%{pos}%' ORDER BY	cuenta LIMIT 30");

            obj.ForEach(o => dtggrid.Rows.Add(o.cuenta, o.descripcion, o.naturaleza, o.nivel, o.tipo, o.id));
        }
        private bool guardarHsconvm()
        {
            h_sconvm obj = new h_sconvm();

            obj.expediente = globales.convertInt(txtExpediente.Text);
            obj.sec        = Convert.ToString(this.secuencia);
            obj.f_convm    = globales.convertDatetime(txtF_Convm.Text);
            obj.nombre_t1  = txtNombre_T1.Text;
            obj.nombre_t2  = txtNombre_T2.Text;
            obj.direc_1    = txtDirec_1.Text;
            obj.direc_2    = txtDirec_2.Text;

            dbaseORM orm = new dbaseORM();

            string query = $"select * from datos.h_sconvm where expediente = {txtExpediente.Text} and sec = '{this.secuencia}'";
            List <Dictionary <string, object> > resultado = orm.query(query);

            bool actualizado;

            if (resultado.Count == 0)
            {
                actualizado = orm.insert <h_sconvm>(obj);
            }
            else
            {
                actualizado = orm.update <h_sconvm>(obj);
            }

            return(actualizado);
        }
Ejemplo n.º 10
0
        private void frmMovimientos_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F2)
            {
                button2_Click(null, null);
            }

            if (e.KeyCode == Keys.Insert)
            {
                if (datos.Rows.Count == 0)
                {
                    DialogResult dialogo = globales.MessageBoxQuestion("¿Deseas insertar un nuevo movimiento?", "Aviso", globales.menuPrincipal);
                    if (dialogo == DialogResult.Yes)
                    {
                        this.esInsertar = true;

                        object[] obj = new object[] { "", "", "", "" };
                        datos.Rows.Insert(0, obj);
                        datos.Rows[0].DefaultCellStyle.BackColor = Color.FromArgb(200, 230, 201);

                        movimientos m   = new movimientos();
                        dbaseORM    orm = new dbaseORM();
                        m = orm.insert <movimientos>(m, true);

                        datos.Rows[0].Cells[3].Value = m.id;
                        datos.CurrentCell            = datos.Rows[0].Cells[0];

                        this.esInsertar = false;
                    }
                }
            }
        }
Ejemplo n.º 11
0
        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;
        }
Ejemplo n.º 12
0
        private bool guardaSantec()
        {
            h_santec obj = new h_santec();

            obj.expediente = globales.convertInt(txtExpediente.Text);
            obj.sec        = Convert.ToString(this.secuencia);
            obj.tomo_inscr = globales.convertInt(txtTomo_Inscr.Text);
            obj.f_inscr_rp = globales.convertDatetime(txtF_Inscr_Rp.Text);
            obj.libr_inscr = globales.convertInt(txtLibr_Incr.Text);
            obj.dist_judic = txtDist_Jud.Text;

            dbaseORM orm   = new dbaseORM();
            string   query = $"select expediente from datos.h_santec where expediente = {txtExpediente.Text} and sec = '{this.secuencia}'";
            List <Dictionary <string, object> > resultado = orm.query(query);
            bool actualiza;

            if (resultado.Count == 0)
            {
                actualiza = orm.insert <h_santec>(obj);
            }
            else
            {
                actualiza = orm.update <h_santec>(obj);
            }

            return(actualiza);
        }
Ejemplo n.º 13
0
        private void actualiza(p_hipote obj)
        {
            try
            {
                dbaseORM orm         = new dbaseORM();
                bool     actualizado = orm.update <p_hipote>(obj);
                if (actualizado)
                {
                    globales.MessageBoxSuccess(" SE ACTUALIZO EL SIGUIENTE FOLIO: " + txtExpediente.Text, "REGISTRO ACTUALIZADO", globales.menuPrincipal);
                    controles(false);
                    limpiacampos();
                    btnGuardar.Enabled = false;
                    btnGuardar.Visible = false;

                    btnModifica.Enabled = true;
                    btnModifica.Visible = true;

                    btnNuevo.Visible      = true;
                    btnNuevo.Enabled      = true;
                    txtExpediente.Enabled = false;
                    btnFolio.Enabled      = false;
                    txtExpediente.Text    = "";
                }
                else
                {
                    globales.MessageBoxError("Error al actualizar el registro", "Aviso", globales.menuPrincipal);
                }
            }

            catch
            {
            }
        }
Ejemplo n.º 14
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;
        }
Ejemplo n.º 15
0
        private void modalEmpleados_Load(object sender, EventArgs e)
        {
            string query = $"select rfc,nombre_em from datos.empleados where  pendiente = 'f' order by rfc asc limit 100";
            List <Dictionary <string, object> > obj = new dbaseORM().query(query);

            obj.ForEach(o => {
                dtggrid.Rows.Add(o["rfc"], o["nombre_em"]);
            });
        }
Ejemplo n.º 16
0
 private void aceptar()
 {
     if (dtggrid.Rows.Count != 0)
     {
         dbaseORM orm = new dbaseORM();
         enviar(orm.query($"select * from datos.empleados where  pendiente = 'f' and (rfc = '{this.rfc}')")[0]);
         this.Owner.Close();
     }
 }
Ejemplo n.º 17
0
 private void aceptar()
 {
     if (dtggrid.Rows.Count != 0)
     {
         dbaseORM orm = new dbaseORM();
         enviar(orm.query($"select * from {this.esquema}.{this.tabla} where folio = {this.folio} {this.t_prestamo}")[0]);
         this.Owner.Close();
     }
 }
Ejemplo n.º 18
0
        private void frmSocioEconomico_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F2)
            {
                cerrar();
            }
            if (this.principalActiva)
            {
                if (this.ventanaPrincipal.dtggrid.Rows.Count == 0)
                {
                    h_sdepec sdepec    = new h_sdepec();
                    int      rowactual = this.ventanaPrincipal.dtggrid.Rows.Count;
                    if (e.KeyCode == Keys.Insert && !globales.boolConsulta)
                    {
                        if (this.ventanaPrincipal.dtggrid.Rows.Count != 0)
                        {
                            return;
                        }

                        if (!this.conExpediente)
                        {
                            globales.MessageBoxExclamation("No se puede insertar registros a la solicitud sin expediente", "Aviso", globales.menuPrincipal);
                            return;
                        }

                        DialogResult p = globales.MessageBoxQuestion("¿Deseas registrar una nuevo registro?", "Aviso", globales.menuPrincipal);
                        if (p == DialogResult.No)
                        {
                            return;
                        }
                        this.esInsertar = true;

                        this.ventanaPrincipal.dtggrid.Rows.Insert(0);
                        this.ventanaPrincipal.dtggrid.Rows[0].Cells[0].Value             = "";
                        this.ventanaPrincipal.dtggrid.Rows[0].Cells[1].Value             = "";
                        this.ventanaPrincipal.dtggrid.Rows[0].Cells[2].Value             = "";
                        this.ventanaPrincipal.dtggrid.Rows[0].Cells[3].Value             = "";
                        this.ventanaPrincipal.dtggrid.Rows[0].Cells[4].Value             = "";
                        this.ventanaPrincipal.dtggrid.Rows[0].DefaultCellStyle.BackColor = Color.FromArgb(200, 230, 201);

                        h_sdepec depec = new h_sdepec();
                        depec.expediente = Convert.ToInt32(txtExpediente.Text);
                        depec.sec        = this.secuencia;

                        dbaseORM orm = new dbaseORM();
                        depec = orm.insert <h_sdepec>(depec, true);

                        this.ventanaPrincipal.dtggrid.Rows[0].Cells[5].Value = depec.id;
                        this.ventanaPrincipal.dtggrid.CurrentCell            = this.ventanaPrincipal.dtggrid.Rows[rowactual].Cells[0];
                    }
                }
                this.esInsertar = false;
            }
            else
            {
            }
        }
Ejemplo n.º 19
0
        public void recibiendoampliacion(string expediente, int opcion, Dictionary <string, Object> datos)
        {
            limpiacampos();
            this.secuencia  = opcion;
            this.expediente = expediente;
            string query = $"select * from datos.h_solici where expediente = {expediente} and sec = '{opcion}'";
            List <Dictionary <string, object> > resultado = globales.consulta(query);
            string tramite = string.Empty;

            tramite = (opcion == 0) ? "Solicitud inicial" : opcion + "° Ampliación";


            this.txtamplia.Text = tramite;

            this.txtRfc.Text          = Convert.ToString(datos["rfc"]);
            this.txtNombre_em.Text    = Convert.ToString(datos["nombre_em"]);
            this.txtExpediente.Text   = Convert.ToString(datos["folio"]);
            this.txtDireccion.Text    = Convert.ToString(datos["direccion"]);
            this.txtDescripcion.Text  = Convert.ToString(datos["descripcion"]);
            this.txtSecretaria.Text   = Convert.ToString(datos["secretaria"]);
            this.txtDirec_inmueb.Text = Convert.ToString(datos["direc_inmu"]);
            this.txtTel_ofic.Text     = Convert.ToString(datos["tel_ofici"]);


            if (resultado.Count == 0)
            {
                globales.MessageBoxExclamation($"Expediente N° {expediente} \nNo se encontro {tramite}", "Aviso", globales.menuPrincipal);
                return;
            }

            query = $"select * from datos.h_snotif where expediente = {txtExpediente.Text} and sec = '{opcion}'";
            h_snotif notif = new dbaseORM().queryForMap <h_snotif>(query);

            txtF_Notif.Text = globales.parseDateTime(notif.f_notif);
            txtN_Notif.Text = notif.n_notif;
            txtC_Notif.Text = notif.c_notif;
            txtNumemis.Text = notif.numemis;
            txtT_Notif.Text = notif.t_notif;

            Dictionary <string, object> diccionario = resultado[0];
            string capPrestado = Convert.ToString(diccionario["cap_prest"]);
            string capPrim     = Convert.ToString(diccionario["cap_prim"]);
            string capUnit     = Convert.ToString(diccionario["cap_unit"]);

            string int_prest = Convert.ToString(diccionario["int_prest"]);
            string int_prim  = Convert.ToString(diccionario["int_prim"]);
            string int_unit  = Convert.ToString(diccionario["int_unit"]);

            string totPrest = Convert.ToString(diccionario["tot_prest"]);
            string totPrim  = Convert.ToString(diccionario["tot_prim"]);
            string totUnit  = Convert.ToString(diccionario["tot_unit"]);

            dtgrid.Rows.Add("PRESTAMO", capPrestado, int_prest, totPrest);
            dtgrid.Rows.Add("PAGO UNICO", capPrim, int_prim, totPrim);
            dtgrid.Rows.Add("POR NOMINA", capUnit, int_unit, totUnit);
        }
Ejemplo n.º 20
0
        private void actualizaSecundario(h_sestse obj)
        {
            dbaseORM orm         = new dbaseORM();
            bool     actualizado = orm.update <h_sestse>(obj);

            if (actualizado)
            {
                globales.MessageBoxSuccess("Registro actualizado correctamente", "Aviso", globales.menuPrincipal);
            }
        }
Ejemplo n.º 21
0
        private void rellenar(Dictionary <string, object> diccionario)
        {
            dataNom.Enabled = true;
            maestro maestro = new dbaseORM().getObject <maestro>(diccionario);

            comboBoxnom.Text = maestro.jpp;
            txtnom.Text      = maestro.nombre;
            txtrfc.Text      = maestro.rfc;
            txtnumemp.Text   = Convert.ToString(maestro.num);
            rellenaGrid();
        }
Ejemplo n.º 22
0
        private void modalQuirografario_Load(object sender, EventArgs e)
        {
            MemberInfo informacion = typeof(clase);
            Type       tipoAssemby = typeof(clase);

            this.tabla   = informacion.Name;
            label45.Text = this.tabla == "p_edocta" ? "Quirografarios" : "Hipotecarios";
            string[] nombreEsquemaArray = tipoAssemby.Namespace.Split('.');
            this.esquema = nombreEsquemaArray[nombreEsquemaArray.Length - 1];

            string query = string.Empty;

            if (!string.IsNullOrWhiteSpace(this.t_prestamo))
            {
                query = $"select * from {esquema}.{tabla} where {t_prestamo.Replace("and","")} order by folio desc limit 100";
            }
            else
            {
                if (this.bandera == "true")
                {
                    query = $"select * from {esquema}.{tabla} where historial_pagado is null order by folio desc limit 100";
                }
                else
                {
                    query = $"select * from {esquema}.{tabla} order by folio desc limit 100";
                }
            }


            List <Dictionary <string, object> > obj = new dbaseORM().query(query);

            obj.ForEach(o => {
                dtggrid.Rows.Add(o["folio"], o["rfc"], o["nombre_em"]);
            });

            if (!string.IsNullOrWhiteSpace(this.t_prestamo))
            {
                query = $"select length(COALESCE(max(folio),0)::text) as cantidad from {this.esquema}.{this.tabla} where {t_prestamo.Replace("and","")}";
            }
            else
            {
                query = $"select length(COALESCE(max(folio),0)::text) as cantidad from {this.esquema}.{this.tabla}";
            }
            //                query = $"select length(COALESCE(max(folio),0)::text) as cantidad from {this.esquema}.{this.tabla} where historial_pagado is null";

            obj             = new dbaseORM().query(query);
            this.totalFolio = globales.convertInt(Convert.ToString(obj[0]["cantidad"]));


            txtBuscar.Text = this.buscar;
        }
Ejemplo n.º 23
0
        private void modificar()
        {
            p_marcha obj = rellenarPagoMarcha();
            dbaseORM orm = new dbaseORM();

            obj.folio = globales.convertInt(txtfolio.Text);

            bool actualizado = orm.update <p_marcha>(obj);

            if (actualizado)
            {
                globales.MessageBoxSuccess("Registro actualizado correctamente", "Aviso", globales.menuPrincipal);
            }
        }
Ejemplo n.º 24
0
        private void txtBuscar_TextChanged(object sender, EventArgs e)
        {
            string query = string.Empty;

            try
            {
                if (!string.IsNullOrWhiteSpace(txtBuscar.Text))
                {
                    if (txtBuscar.Text.Contains("..") || txtBuscar.Text.Contains("."))
                    {
                        string   texto = txtBuscar.Text.Replace("..", ".");
                        string[] split = texto.Split('.');

                        string nombre_em = string.Empty;

                        foreach (string i in split)
                        {
                            if (string.IsNullOrWhiteSpace(i))
                            {
                                continue;
                            }
                            nombre_em += $" nombre_em like '%{i}%' ,";
                        }
                        nombre_em = nombre_em.Substring(0, nombre_em.Length - 1).Replace(",", " and ");

                        query = $"select * from datos.empleados where  pendiente = 'f' and  (rfc like '{txtBuscar.Text}%' or {nombre_em})  order by rfc,nombre_em desc limit 100";
                    }
                    else
                    {
                        query = $"select * from datos.empleados where  pendiente = 'f' and (rfc like '{txtBuscar.Text}%' or nombre_em like '%{txtBuscar.Text}%')  order by  rfc,nombre_em desc limit 100";
                    }
                }
                else
                {
                    query = $"select rfc,nombre_em from datos.empleados where pendiente = 'f' order by rfc,nombre_em asc limit 100";
                }
            }
            catch
            {
            }

            dtggrid.Rows.Clear();

            List <Dictionary <string, object> > obj = new dbaseORM().query(query);

            obj.ForEach(o => {
                dtggrid.Rows.Add(o["rfc"], o["nombre_em"]);
            });
        }
Ejemplo n.º 25
0
        private void recibiendoampliacion(string expediente, int opcion, Dictionary <string, object> datos)
        {
            limpiacampos();
            this.expediente    = expediente;
            txtExpediente.Text = expediente;
            string query = $"select expediente,sec from datos.h_solici where expediente = {expediente} and sec = '{opcion}'";
            List <Dictionary <string, object> > resultado = globales.consulta(query);
            string tramite = string.Empty;

            tramite        = (opcion == 0) ? "Solicitud inicial" : opcion + "° Ampliación";
            this.secuencia = opcion.ToString();

            this.txtamplia.Text = tramite;

            query = "select * from datos.p_hipote where folio = " + expediente;
            p_hipote hipo = new dbaseORM().queryForMap <p_hipote>(query);

            this.ventanaPrincipal.txtRfc.Text          = hipo.rfc;
            this.ventanaPrincipal.txtNombre_em.Text    = hipo.nombre_em;
            this.ventanaPrincipal.txtDireccion.Text    = hipo.direccion;
            this.ventanaPrincipal.txtSecretaria.Text   = hipo.secretaria;
            this.ventanaPrincipal.txtDirec_inmueb.Text = hipo.direc_inmu;
            this.ventanaPrincipal.txtDescripcion.Text  = hipo.descripcion;
            this.ventanaPrincipal.txtTel_ofic.Text     = hipo.tel_ofici;

            if (resultado.Count == 0)
            {
                this.conExpediente = false;
                globales.MessageBoxExclamation($"Expediente N° {expediente} \nNo se encontro {tramite}", "Aviso", globales.menuPrincipal);
                return;
            }

            this.conExpediente = true;

            query = $"select * from datos.h_sdepec where expediente = {hipo.folio} and sec = '{resultado[0]["sec"]}' order by id ";
            List <h_sdepec> sdepec = new dbaseORM().queryForList <h_sdepec>(query);

            sdepec.ForEach(o => {
                this.ventanaPrincipal.dtggrid.Rows.Add(
                    o.nom_depec, o.edad, o.parentesco, o.escolaridad, o.ocupacion, o.id
                    );
            });

            query = $"select * from datos.h_sestse where expediente = {hipo.folio} and sec = '{resultado[0]["sec"]}'";
            h_sestse sestse = new dbaseORM().queryForMap <h_sestse>(query);

            rellenarSecundario(sestse);
        }
Ejemplo n.º 26
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);
            }
        }
Ejemplo n.º 27
0
        public void recibiendoampliacion(string expediente, int opcion, Dictionary <string, Object> datos)
        {
            limpiacampos();
            this.expediente = expediente;
            string query = $"select expediente,sec from datos.h_solici where expediente = {expediente} and sec = '{opcion}'";
            List <Dictionary <string, object> > resultado = globales.consulta(query);
            string tramite = string.Empty;

            tramite = (opcion == 0) ? "Solicitud inicial" : opcion + "° Ampliación";


            this.txtamplia.Text = tramite;

            this.txtRfc.Text          = Convert.ToString(datos["rfc"]);
            this.txtNombre_em.Text    = Convert.ToString(datos["nombre_em"]);
            this.txtExpediente.Text   = Convert.ToString(datos["folio"]);
            this.txtDireccion.Text    = Convert.ToString(datos["direccion"]);
            this.txtDescripcion.Text  = Convert.ToString(datos["descripcion"]);
            this.txtSecretaria.Text   = Convert.ToString(datos["secretaria"]);
            this.txtDirec_inmueb.Text = Convert.ToString(datos["direc_inmu"]);
            this.txtTel_ofic.Text     = Convert.ToString(datos["tel_ofici"]);

            if (resultado.Count == 0)
            {
                globales.MessageBoxExclamation($"Expediente N° {expediente} \nNo se encontro {tramite}", "Aviso", globales.menuPrincipal);
                return;
            }

            query = $"select * from datos.h_sretec where expediente = {txtExpediente.Text} and sec = '{opcion}'";
            h_sretec obj = new dbaseORM().queryForMap <h_sretec>(query);

            this.txtF_Elab.Text       = globales.parseDateTime(obj.f_elab);
            this.txtAreapredio.Text   = Convert.ToString(obj.areapredio);
            this.txtNiveles.Text      = Convert.ToString(obj.niveles);
            this.txtHabitac.Text      = Convert.ToString(obj.habitac);
            this.txtDesghabit.Text    = obj.desghabit;
            this.txtArea_Const.Text   = Convert.ToString(obj.area_const);
            this.txtAvaObrNeg.Text    = Convert.ToString(obj.avaobneg);
            this.txtAvaacab.Text      = Convert.ToString(obj.avaacab);
            this.txtImp_estimt.Text   = Convert.ToString(obj.imp_estimt);
            this.txtImp_Avance.Text   = Convert.ToString(obj.imp_avance);
            this.txtObserv.Text       = obj.observ;
            this.txtImp_Faltante.Text = Convert.ToString(obj.imp_faltante);
            this.txtDiagnostico.Text  = obj.diagnostico;

            this.secuencia = opcion;
        }
Ejemplo n.º 28
0
        private void btnP_hipote_Click(object sender, EventArgs e)
        {
            DialogResult dialogo = globales.MessageBoxQuestion("¿Deseas guardar los cambios?", "Aviso", globales.menuPrincipal);

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

            if (string.IsNullOrWhiteSpace(txtExpediente.Text))
            {
                globales.MessageBoxExclamation("Favor de elegir un expediente", "Aviso", globales.menuPrincipal);
                return;
            }

            dbaseORM orm    = new dbaseORM();
            p_hipote hipote = llenarHipote();

            bool actualizado = orm.update <p_hipote>(hipote);

            if (actualizado)
            {
                string query = $"select expediente from datos.h_sretec where expediente = {txtExpediente.Text} and sec = '{this.secuencia}'";
                List <Dictionary <string, object> > resultado = orm.query(query);
                h_sretec sretec = new h_sretec();
                sretec.expediente = globales.convertInt(txtExpediente.Text);
                sretec.sec        = Convert.ToString(this.secuencia);
                sretec            = llenarSretec(sretec);

                if (resultado.Count == 0)
                {
                    actualizado = orm.insert <h_sretec>(sretec);
                }
                else
                {
                    actualizado = orm.update <h_sretec>(sretec);
                }

                if (actualizado)
                {
                    globales.MessageBoxSuccess("Registro actualizado correctamente", "Aviso", globales.menuPrincipal);
                }
            }
        }
Ejemplo n.º 29
0
        private void cellvalueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (editadoprogramadamente)
            {
                editadoprogramadamente = false;
                return;
            }
            int c = e.RowIndex;

            if (c == -1)
            {
                return;
            }



            if (this.esInsertar)
            {
                return;
            }

            editadoprogramadamente = true;
            this.ventanaPrincipal.dtggrid.Rows[this.row].Cells[1].Value = globales.convertInt(Convert.ToString(this.ventanaPrincipal.dtggrid.Rows[this.row].Cells[1].Value));
            editadoprogramadamente = false;

            h_sdepec h = new h_sdepec();

            h.expediente  = Convert.ToInt32(txtExpediente.Text);
            h.sec         = this.secuencia;
            h.id          = Convert.ToInt32(this.ventanaPrincipal.dtggrid.Rows[this.row].Cells[5].Value);
            h.nom_depec   = this.ventanaPrincipal.dtggrid.Rows[this.row].Cells[0].Value.ToString();
            h.edad        = Convert.ToInt32(this.ventanaPrincipal.dtggrid.Rows[this.row].Cells[1].Value);
            h.parentesco  = Convert.ToString(this.ventanaPrincipal.dtggrid.Rows[this.row].Cells[2].Value);
            h.escolaridad = Convert.ToString(this.ventanaPrincipal.dtggrid.Rows[this.row].Cells[3].Value);
            h.ocupacion   = Convert.ToString(this.ventanaPrincipal.dtggrid.Rows[this.row].Cells[4].Value);

            dbaseORM orm         = new dbaseORM();
            bool     actualizado = orm.update <h_sdepec>(h);


            editadoprogramadamente = false;
        }
Ejemplo n.º 30
0
        public void recibiendoampliacion(string expediente, int opcion, Dictionary <string, Object> datos)
        {
            limpiacampos();
            this.expediente = expediente;
            this.secuencia  = opcion;
            string query = $"select * from datos.h_solici where expediente = {expediente} and sec = '{opcion}'";
            List <Dictionary <string, object> > resultado = globales.consulta(query);
            string tramite = string.Empty;

            tramite = (opcion == 0) ? "Solicitud inicial" : opcion + "° Ampliación";


            this.txtamplia.Text = tramite;

            this.txtRfc.Text          = Convert.ToString(datos["rfc"]);
            this.txtNombre_em.Text    = Convert.ToString(datos["nombre_em"]);
            this.txtExpediente.Text   = Convert.ToString(datos["folio"]);
            this.txtDireccion.Text    = Convert.ToString(datos["direccion"]);
            this.txtDescripcion.Text  = Convert.ToString(datos["descripcion"]);
            this.txtSecretaria.Text   = Convert.ToString(datos["secretaria"]);
            this.txtDirec_inmueb.Text = Convert.ToString(datos["direc_inmu"]);
            this.txtTel_ofic.Text     = Convert.ToString(datos["tel_ofici"]);


            if (resultado.Count == 0)
            {
                globales.MessageBoxExclamation($"Expediente N° {expediente} \nNo se encontro {tramite}", "Aviso", globales.menuPrincipal);
                return;
            }

            query = $"select * from datos.h_sconsj where expediente = {txtExpediente.Text} and sec = '{this.secuencia}'";
            h_sconsj consejo = new dbaseORM().queryForMap <h_sconsj>(query);

            txtProyecto.Text = consejo.proyecto;
            txtCred_Ant.Text = consejo.cred_ant;
            txtAvance_o.Text = consejo.avance_o;

            txtNececidad.Text     = consejo.necesida;
            txtSolvencia.Text     = consejo.solvencia;
            txtObvervaciones.Text = consejo.observacion;
        }