Esempio n. 1
0
        public static void InsertarDatosLocalizacion(String nroDoc, String correlativo, String idCliente, String tipoDoc, String destinoOperacion, String idSitio,
                                                     String nroSerie, DateTime fecDoc, String idMoneda, String idUsuario)
        {
            BDGP helper = BDGP.GetInstance();
            int  resp   = helper.Ejecute("PROC_COVI_INSERTAR_DATOS_TRIBUTARIOS_VENTA", nroDoc, correlativo, idCliente, tipoDoc, destinoOperacion, idSitio,
                                         nroSerie, fecDoc, idMoneda, idUsuario);

            if (resp == -2)
            {
                throw helper.MensajeErrorReal;
            }
        }
        public static ClaseClienteBE obtenerClaseCliente(string idClase)
        {
            IDataReader           reader = BDGP.GetInstance().CargarDataReaderProc("COVI_OBTENER_CLASE_CLIENTE", idClase);
            ClaseClienteBE        cli    = null;
            List <ClaseClienteBE> ls     = Util.ConvertirAEntidades <ClaseClienteBE>(reader);

            if (ls != null && ls.Count > 0)
            {
                cli = ls.First <ClaseClienteBE>();
            }
            return(cli);
        }
Esempio n. 3
0
        public static List <EstacionesBE> obtenerEstacionesPeaje()
        {
            List <EstacionesBE> listaEstaciones = new List <EstacionesBE>();

            IDataReader reader = BDGP.GetInstance().CargarDataReaderProc("ObtenerEstacionesPeaje");

            if (reader != null)
            {
                listaEstaciones = Util.ConvertirAEntidades <EstacionesBE>(reader);
            }
            return(listaEstaciones);
        }
Esempio n. 4
0
        public static void guardarDatosAdicionales(int jrnentry, string turno,
                                                   string estacion, string categoria, string numeroVale, string placa, string numeroFactura)
        {
            try
            {
                if (turno == null)
                {
                    turno = "";
                }

                if (estacion == null)
                {
                    estacion = "";
                }

                if (categoria == null)
                {
                    categoria = "";
                }

                if (numeroVale == null)
                {
                    numeroVale = "";
                }

                if (placa == null)
                {
                    placa = "";
                }

                if (numeroFactura == null)
                {
                    numeroFactura = "";
                }


                int resp = BDGP.GetInstance().Ejecute("PROC_COV_ADIC_CONS_INSERTAR_MODIFICAR", jrnentry, turno,
                                                      estacion, categoria, numeroVale, placa, numeroFactura);
                if (resp == -2)
                {
                    throw BDGP.GetInstance().MensajeErrorReal;
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (DataException ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
        //CURID -> Z-US$
        public static Int32 ObtenerCantidadDecimalesPorMoneda(string IdMoneda)
        {
            Int32            cantDec = 0;
            var              query   = string.Format(@"SELECT DECPLCUR-1 CANTDEC FROM DYNAMICS..MC40200 WHERE CURNCYID = '{0}'", IdMoneda);
            DataTable        dt      = BDGP.GetInstance().CargarDataTableSQL(query, "formatoMoneda");
            Nullable <Int32> numDec  = dt.Rows[0].Field <Nullable <Int32> > ("CANTDEC");

            if (numDec != null)
            {
                cantDec = numDec.Value;
            }
            return(cantDec);
        }
Esempio n. 6
0
        public static List <CasetaBE> listaCasetas()
        {
            List <CasetaBE> listaCasetas = new List <CasetaBE>();

            IDataReader reader = BDGP.GetInstance().CargarDataReaderProc("PROC_LISTA_CASETAS");

            if (reader != null)
            {
                listaCasetas = Util.ConvertirAEntidades <CasetaBE>(reader);
            }

            return(listaCasetas);
        }
Esempio n. 7
0
        public static List <CasetaBE> obtenerCasetasPeaje(string cod_estacion)
        {
            List <CasetaBE> listaCasetas = new List <CasetaBE>();

            IDataReader reader = BDGP.GetInstance().CargarDataReaderProc("PROC_OBTENER_CASETAS_ESTACION_TODAS", cod_estacion);

            if (reader != null)
            {
                listaCasetas = Util.ConvertirAEntidades <CasetaBE>(reader);
            }

            return(listaCasetas);
        }
Esempio n. 8
0
        public static List <EstacionesBE> obtenerEstacionesPeajeTodas()
        {
            BDGP helper = BDGP.GetInstance();
            List <EstacionesBE> listaEstaciones = new List <EstacionesBE>();

            IDataReader reader = helper.CargarDataReaderProc("ObtenerEstacionesPeajeTodas");

            if (reader == null)
            {
                throw helper.getErrorReal();
            }
            listaEstaciones = Util.ConvertirAEntidades <EstacionesBE>(reader);
            return(listaEstaciones);
        }
Esempio n. 9
0
        public static bool existeClienteGP(string idCliente)
        {
            DataTable        tabla       = BDGP.GetInstance().CargarDataTableProc("validarExistenciaCliente", idCliente);
            Nullable <Int32> numClientes = tabla.Rows[0].Field <Nullable <Int32> >(0);

            if (numClientes != null)
            {
                if (numClientes.Value > 0)
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 10
0
        public static void insertarClienteGP(ClienteBE cli, string userId)
        {
            int  resp   = 0;
            BDGP helper = BDGP.GetInstance();

            try
            {
                // transformar datos
                cli.IdVendedor      = cli.IdVendedor == String.Empty || cli.IdVendedor == null ? "" : cli.IdVendedor;
                cli.Nombre1         = cli.Nombre1 == String.Empty || cli.Nombre1 == null ? "" : cli.Nombre1;
                cli.Nombre2         = cli.Nombre2 == String.Empty || cli.Nombre2 == null? "" : cli.Nombre2;
                cli.ApePaterno      = cli.ApePaterno == String.Empty || cli.ApePaterno == null ? "" : cli.ApePaterno;
                cli.ApeMaterno      = cli.ApeMaterno == String.Empty || cli.ApeMaterno == null ? "" : cli.ApeMaterno;
                cli.CondNivelPrecio = cli.CondNivelPrecio == String.Empty || cli.CondNivelPrecio == null ? "" : cli.CondNivelPrecio;
                cli.TipoDocumento   = cli.TipoDocumento == String.Empty || cli.TipoDocumento == null ? "" : cli.TipoDocumento;

                // verificar tipo de persona
                if (cli.Tipopersona == 1)
                {
                    resp = helper.Ejecute("InterfazCovi_InsertaClienteLOC",
                                          cli.NomCliente,
                                          cli.IdCliente,
                                          cli.Nombre1, cli.Nombre2, cli.ApePaterno, cli.ApeMaterno, cli.IdCliente, cli.Tipopersona,
                                          cli.TipoDocumento, "", userId, cli.IdVendedor, cli.CondNivelPrecio, "", "");
                }
                if (cli.Tipopersona == 2 || cli.Tipopersona == 3 || cli.Tipopersona == 4)
                {
                    // persona juridica
                    resp = helper.Ejecute("InterfazCovi_InsertaClienteLOC",
                                          cli.NomCliente,
                                          cli.IdCliente,
                                          "", "", "", "", cli.IdCliente, cli.Tipopersona,
                                          cli.TipoDocumento, cli.NomCliente, userId, cli.IdVendedor, cli.CondNivelPrecio, "", "");
                }

                if (resp == -2)
                {
                    throw helper.MensajeErrorReal;
                }
            }
            catch (DataException ex) {
                throw ex;
            }
        }
        public static int crearAsientosContables(AsientoContable a)

        {
            int       jrentry = 0;
            DataTable tabla   = BDGP.GetInstance().CargarDataTableProc("covi_insertarAsientosContables", a.nroLote,
                                                                       a.REFRENCE, a.monto, a.cuentaDebito, a.cuentaCredito, a.DSCRIPTN,
                                                                       a.CURNCYID, a.TRXDATE, a.RVRSNGDT, a.EXPNDATE, a.EXCHDATE, a.SOURCDOC);

            if (BDGP.GetInstance().MensajeErrorReal != null)
            {
                throw BDGP.GetInstance().MensajeErrorReal;
            }

            if (tabla != null && tabla.Rows.Count > 0)
            {
                jrentry = tabla.Rows[0].Field <Int32>(0);
            }
            return(jrentry);
        }
Esempio n. 12
0
        public static bool existeClienteGP(string idCliente)
        {
            BDGP      helper = BDGP.GetInstance();
            DataTable tabla  = helper.CargarDataTableProc("validarExistenciaCliente", idCliente);

            if (tabla == null)
            {
                throw helper.MensajeErrorReal;
            }
            Nullable <Int32> numClientes = tabla.Rows[0].Field <Nullable <Int32> >(0);

            if (numClientes != null)
            {
                if (numClientes.Value > 0)
                {
                    return(true);
                }
            }
            return(false);
        }