示例#1
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);
        }
示例#2
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);
        }
示例#3
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);
        }
        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);
        }
示例#5
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);
        }
        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);
        }
示例#7
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);
        }
示例#8
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();
     }
 }
示例#9
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();
     }
 }
示例#10
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);
                }
            }
        }
示例#11
0
        private void insertar()
        {
            p_marcha obj = rellenarPagoMarcha();
            dbaseORM orm = new dbaseORM();

            List <Dictionary <string, object> > resultado = orm.query("select COALESCE(max(folio)+1,1) as maximo from datos.p_marcha");
            string maximo = string.Empty;

            if (resultado.Count != 0)
            {
                maximo = Convert.ToString(resultado[0]["maximo"]);
            }

            obj.folio = globales.convertInt(maximo);

            bool insertado = orm.insert <p_marcha>(obj);

            if (insertado)
            {
                globales.MessageBoxSuccess("Registro guardado correctamente", "Aviso", globales.menuPrincipal);
            }
        }
示例#12
0
        private bool guardaSemisi()
        {
            h_semisi obj = new h_semisi();

            obj.expediente = globales.convertInt(txtExpediente.Text);
            obj.sec        = Convert.ToString(this.secuencia);
            obj.n_emision  = txtN_Emision.Text;
            obj.f_recibo   = globales.convertDatetime(txtF_Recibo.Text);
            obj.importe    = globales.convertDouble(txtImporte.Text);

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


            bool actualiza;

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

            this.nuevaemision    = false;
            this.button1.Visible = true;

            return(actualiza);
        }
示例#13
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;
        }