Exemplo n.º 1
0
        public DatosImpresion BuscarDatosImpresion()
        {
            DatosImpresion objDatosImpresion = new DatosImpresion();
            string         strSql;

            strSql  = "select  NombreComercio,Direccion,Provincia,Localidad,CodigoInterno,ComentarioLinea1,ComentarioLinea2,ComentarioLinea3,NombreImpresora ";
            strSql += " from dbo.Impresion";
            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            if (dt.Rows.Count > 0)
            {
                objDatosImpresion.StrComercio         = dt.Rows[0]["NombreComercio"].ToString();
                objDatosImpresion.StrDireccion        = dt.Rows[0]["Direccion"].ToString();
                objDatosImpresion.StrProvincia        = dt.Rows[0]["Provincia"].ToString();
                objDatosImpresion.StrLocalidad        = dt.Rows[0]["Localidad"].ToString();
                objDatosImpresion.StrCodigoInterno    = dt.Rows[0]["CodigoInterno"].ToString();
                objDatosImpresion.StrComentarioLinea1 = dt.Rows[0]["ComentarioLinea1"].ToString();
                objDatosImpresion.StrComentarioLinea2 = dt.Rows[0]["ComentarioLinea2"].ToString();
                objDatosImpresion.StrComertarioLinea3 = dt.Rows[0]["ComentarioLinea3"].ToString();
                objDatosImpresion.StrImpresora        = dt.Rows[0]["NombreImpresora"].ToString();

                return(objDatosImpresion);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public int BuscoMedioDePagoPredeterminado()
        {
            string strSql;

            strSql = " select mediopago from Medio_Pago where predeterminado=1 ";

            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                return(Convert.ToInt32(dt2.Rows[0]["mediopago"].ToString()));
            }


            else
            {
                strSql = " select mediopago from Medio_Pago where mediopago  =( select min(mediopago) from Medio_Pago)  ";

                LlenaCombos objLlenaCombos3 = new LlenaCombos();
                DataTable   dt3             = objLlenaCombos3.GetSqlDataAdapterbySql(strSql);

                if (dt3 != null)
                {
                    return(Convert.ToInt32(dt3.Rows[0]["mediopago"].ToString()));
                }
                else
                {
                    return(0);
                }
            }
        }
Exemplo n.º 3
0
        public List <Telefonos> BuscoTelefonosCliente(int intCodigo)
        {
            string           strSql;
            Telefonos        objTelefonos;
            List <Telefonos> listTelefonos = new List <Telefonos>();

            strSql  = "select cc_id,cc_vinculo,cc_tipotel,cc_tel, interno ";
            strSql += "from dbo.Contactos_cliente where cli_id=" + intCodigo;
            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    objTelefonos            = new Telefonos();
                    objTelefonos.IntCodigo  = Convert.ToInt32(dt2.Rows[i]["cc_id"].ToString());
                    objTelefonos.StrVinculo = dt2.Rows[i]["cc_vinculo"].ToString();
                    objTelefonos.StrTipotel = dt2.Rows[i]["cc_tipotel"].ToString();
                    objTelefonos.StrTel     = dt2.Rows[i]["cc_tel"].ToString();
                    objTelefonos.StrInterno = dt2.Rows[i]["interno"].ToString();
                    listTelefonos.Add(objTelefonos);
                }
            }
            return(listTelefonos);
        }
Exemplo n.º 4
0
        public List <SubVentaTarjeta> BuscoTarjetasEnVenta(int intCodigo)
        {
            string                 strSql;
            SubVentaTarjeta        objSubVentaTarjeta;
            List <SubVentaTarjeta> listTarjetasEnVenta = new List <SubVentaTarjeta>();

            strSql  = "select id,tarjetaabona,tarjetanombre,tarjetanumero,tarjetacuotas,tipo ";
            strSql += " from dbo.Tarjetas_Detalle where facturaid = " + intCodigo;

            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    objSubVentaTarjeta            = new SubVentaTarjeta();
                    objSubVentaTarjeta.IntCodigo  = Convert.ToInt32(dt2.Rows[i]["id"].ToString());
                    objSubVentaTarjeta.DoAbona    = Convert.ToDecimal(dt2.Rows[i]["tarjetaabona"].ToString());
                    objSubVentaTarjeta.StrTarjeta = dt2.Rows[i]["tarjetanombre"].ToString();
                    objSubVentaTarjeta.StrNumero  = dt2.Rows[i]["tarjetanumero"].ToString();
                    objSubVentaTarjeta.StrCuotas  = dt2.Rows[i]["tarjetacuotas"].ToString();
                    objSubVentaTarjeta.StrTipo    = dt2.Rows[i]["tipo"].ToString();
                    listTarjetasEnVenta.Add(objSubVentaTarjeta);
                }
            }
            return(listTarjetasEnVenta);
        }
Exemplo n.º 5
0
        public List <Ventas_Pagos> BuscoPagos(int intCodigo)
        {
            string              strSql;
            Ventas_Pagos        objPagos;
            List <Ventas_Pagos> listPagos = new List <Ventas_Pagos>();

            strSql  = "select ventas_pagos_id,ventas_id,fecha,importe, cierrecajaid, mediopago ";
            strSql += "from Ventas_Pagos where ventas_id=" + intCodigo;
            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    objPagos               = new Ventas_Pagos();
                    objPagos.IntCodigo     = Convert.ToInt32(dt2.Rows[i]["ventas_pagos_id"].ToString());
                    objPagos.DtFecha       = Convert.ToDateTime(dt2.Rows[i]["fecha"].ToString());
                    objPagos.DeImporte     = Convert.ToDecimal(dt2.Rows[i]["importe"].ToString());
                    objPagos.IntNumeroCaja = Convert.ToInt32(dt2.Rows[i]["cierrecajaid"].ToString());
                    objPagos.IntMedioPago  = Convert.ToInt32(dt2.Rows[i]["mediopago"].ToString());

                    listPagos.Add(objPagos);
                }
            }
            return(listPagos);
        }
Exemplo n.º 6
0
        public bool ExisteDiccionario(string strParametro, string strValor)
        {
            string strSql;

            strSql  = "select count(*) as cantidad";
            strSql += " from dbo.Diccionario where dd_parametro = '" + strParametro + "'";
            strSql += " and cc_valor1= '" + strValor + "'";
            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            //if (dt != null)
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["cantidad"].ToString() == "0")
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 7
0
        public Devoluciones BuscarDevoluciones(int intCodigo)
        {
            string strSql;

            Devoluciones objDevoluciones = new Devoluciones();

            objDevoluciones.ObjEmpleado = new Empleados();
            objDevoluciones.ObjCliente  = new Clientes();

            strSql  = "SELECT d.devolucionid,d.fechaalta,d.empleadoid,d.clienteid,d.observaciones,d.total,d.estado,d.listaprecio, isnull(d.cierrecajaid,0) cierrecajaid  ";
            strSql += " FROM Devoluciones d where d.devolucionid =  " + intCodigo;

            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            objDevoluciones.IntCodigo             = intCodigo;
            objDevoluciones.DtFecha               = Convert.ToDateTime(dt.Rows[0]["fechaalta"].ToString());
            objDevoluciones.ObjEmpleado.IntCodigo = Convert.ToInt32(dt.Rows[0]["empleadoid"].ToString());
            objDevoluciones.ObjCliente.IntCodigo  = Convert.ToInt32(dt.Rows[0]["clienteid"].ToString());
            objDevoluciones.StrObservaciones      = dt.Rows[0]["observaciones"].ToString();
            objDevoluciones.DoTotal               = Convert.ToDecimal(dt.Rows[0]["total"].ToString());
            objDevoluciones.StrEstado             = dt.Rows[0]["estado"].ToString();
            objDevoluciones.StrListaPrecio        = dt.Rows[0]["listaprecio"].ToString();
            objDevoluciones.IntNumeroCaja         = Convert.ToInt32(dt.Rows[0]["cierrecajaid"].ToString());

            objDevoluciones.ListArticulosPorDevolucion = BuscoArticulosxDevolucion(objDevoluciones.IntCodigo);

            return(objDevoluciones);
        }
Exemplo n.º 8
0
        public DataTable obtenerTodasLasPanallas(string strModulo, string strPantalla)
        {
            string strSql;

            if (strModulo == "TODOS" && strPantalla == "TODAS")
            {
                strSql  = "select cc_valor1,cc_valor2 ";
                strSql += " from dbo.Diccionario where dd_parametro= 'PANTALLAS'";
                strSql += " and cc_valor1 <> 'TODOS' ";
                strSql += " and cc_valor2 <> 'TODAS' ";
            }
            else
            //Si selecciona Pantalla Todas
            //Me basta con saber si tiene un permiso cargado para ese modulo
            {
                strSql  = "select cc_valor1,cc_valor2 ";
                strSql += " from dbo.Diccionario where dd_parametro= 'PANTALLAS'";
                strSql += " and cc_valor2 <> 'TODAS' ";
                strSql += " and cc_valor1 = '" + strModulo + "'";
            }

            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            return(dt);
        }
Exemplo n.º 9
0
        public List <Perfiles> BuscarPerfil(string strUsuario)
        {
            string          strSql;
            Perfiles        objPerfiles;
            List <Perfiles> objListPerfiles = new List <Perfiles>();

            strSql  = "select id, usuarioid,modulo,pantalla,permiso ";
            strSql += "  from Perfiles where usuarioid = (select id from usuarios where usuario='" + strUsuario.Trim().ToUpper() + "')";

            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt2            = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    objPerfiles             = new Perfiles();
                    objPerfiles.IntCodigo   = Convert.ToInt32(dt2.Rows[i]["id"].ToString());
                    objPerfiles.IntUsuario  = Convert.ToInt32(dt2.Rows[i]["usuarioid"].ToString());
                    objPerfiles.StrModulo   = dt2.Rows[i]["modulo"].ToString();
                    objPerfiles.StrPantalla = dt2.Rows[i]["pantalla"].ToString();
                    objPerfiles.StrPermiso  = dt2.Rows[i]["permiso"].ToString();
                    objListPerfiles.Add(objPerfiles);
                }
            }
            return(objListPerfiles);
        }
Exemplo n.º 10
0
        public bool EmpleadoDadoDeBaja(int intCodigo)
        {
            Empleados objEmpleados = new Empleados();
            string    strSql;

            strSql  = "SELECT  fechabaja";
            strSql += " from dbo.Empleados where emp_id =" + intCodigo;
            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            if (dt != null)
            {
                if (string.IsNullOrEmpty(dt.Rows[0]["fechabaja"].ToString()))
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 11
0
        public void EliminaPerfil(int intUsuarioId, string strModulo, string strPantalla)
        {
            string   strSql;
            Perfiles objPerfiles = new Perfiles();

            //Si selecciona Modulo y Pantalla Todas
            //Me basta con saber si tiene un permiso cargado
            if (strModulo == "TODOS" && strPantalla == "TODAS")
            {
                strSql  = "delete";
                strSql += " FROM Perfiles where usuarioid = " + intUsuarioId;
            }
            else if (strPantalla == "TODAS")
            //Si selecciona Pantalla Todas
            //Me basta con saber si tiene un permiso cargado para ese modulo
            {
                strSql  = "delete";
                strSql += " FROM Perfiles where usuarioid = " + intUsuarioId;
                strSql += " AND modulo = '" + strModulo + "'";
            }
            else
            {
                strSql  = "delete";
                strSql += " FROM Perfiles where usuarioid = " + intUsuarioId;
                strSql += " AND modulo = '" + strModulo + "'";
                strSql += " AND pantalla = '" + strPantalla + "'";
            }
            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);
        }
Exemplo n.º 12
0
        public void CargarClientesConPredeterminado(ComboBox combo)
        {
            string strSql;
            bool   boPredeterminado = false;

            strSql = "select cli_id, convert(varchar, cli_id) + ' - '+  cli_nombre + ' ' + cli_apellido as nombre,predeterminado from clientes where fechabaja is null ";
            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            combo.DataSource    = dt;
            combo.ValueMember   = "cli_id";
            combo.DisplayMember = "nombre";

            //Aca tengo q recorrer y buscar el predeterminado

            if (dt != null)
            {
                for (int i = 0; i <= Convert.ToInt32(dt.Rows.Count) - 1; i++)
                {
                    if (Convert.ToBoolean(dt.Rows[i]["predeterminado"].ToString()))
                    {
                        combo.Text          = dt.Rows[i]["nombre"].ToString();
                        combo.SelectedValue = Convert.ToInt32(dt.Rows[i]["cli_id"].ToString());
                        boPredeterminado    = true;
                        break;
                    }
                }
            }

            if (boPredeterminado == false)
            {
                combo.Text          = "";
                combo.SelectedIndex = -1;
            }
        }
Exemplo n.º 13
0
        public Usuarios ExisteUsuarioContraseña(string strUsuario, string strContraseña)
        {
            string strSql;

            strSql  = "select id, usuario, nombre_apellido, es_admin, contraseña";
            strSql += " from dbo.Usuarios where usuario ='" + strUsuario + "'";
            strSql += " and contraseña = '" + strContraseña + "'";

            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            //if (dt != null)
            if (dt.Rows.Count > 0)
            {
                Usuarios objUsuarios = new Usuarios();
                objUsuarios.IntCodigo         = Convert.ToInt32(dt.Rows[0]["id"].ToString());
                objUsuarios.StrUsuario        = dt.Rows[0]["usuario"].ToString();
                objUsuarios.StrNombreApellido = dt.Rows[0]["nombre_apellido"].ToString();
                objUsuarios.IntEsAdmin        = Convert.ToInt32(dt.Rows[0]["es_admin"].ToString());
                objUsuarios.StrContraseña     = dt.Rows[0]["contraseña"].ToString();
                return(objUsuarios);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 14
0
        public bool ExisteUsuario(string strUsuario)
        {
            string strSql;

            strSql  = "select count(*) as cantidad";
            strSql += " from dbo.Usuarios where usuario ='" + strUsuario + "'";

            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            //if (dt != null)
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["cantidad"].ToString() == "0")
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 15
0
        public bool ValidaFechaAperturaCierreCaja(int intNumeroCaja)
        {
            string strSql;


            strSql  = " select DATEADD(D, 0, DATEDIFF(D, 0,fecha_apertura)) fecha_apertura ";
            strSql += " from Cierre_caja where cierrecajaid = " + intNumeroCaja;

            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);


            if (dt2 != null)
            {
                if (dt2.Rows.Count > 0)
                {
                    if (Convert.ToDateTime(dt2.Rows[0]["fecha_apertura"].ToString()) != DateTime.Today)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 16
0
        private bool ExisteCodigoExtra(string strCodigo)
        {
            string strSql;

            strSql  = "select count(1) as cantidad from Articulos";
            strSql += " where fechabaja is null and idextra =" + strCodigo;

            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            //if (dt != null)
            try
            {
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["cantidad"].ToString() == "0")
                    {
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }
Exemplo n.º 17
0
        public CierreDeCaja DineroInicial(Int32 intIdCierreCaja)
        {
            string       strSql;
            CierreDeCaja objCierreDeCaja = new CierreDeCaja();

            strSql  = " select cierrecajaid,total, fecha from dbo.Cierre_Caja ";
            strSql += " WHERE cierrecajaid =" + intIdCierreCaja;
            //strSql += " where fecha between DATEADD(D, 0, DATEDIFF(D, 0," + "'" + strFecha + "'))" + " and DATEADD(D, 0, DATEDIFF(D, 0," + "'" + strFecha + "')+1)";

            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2.Rows.Count != 0)
            {
                objCierreDeCaja.IntCodigo = Convert.ToInt32(dt2.Rows[0]["cierrecajaid"].ToString());
                objCierreDeCaja.DeTotal   = Redondeo(Convert.ToDecimal(dt2.Rows[0]["total"].ToString()));
                objCierreDeCaja.DtFecha   = Convert.ToDateTime(dt2.Rows[0]["fecha"].ToString());

                return(objCierreDeCaja);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 18
0
        public bool ArticuloDadoDeBaja(int intCodigo)
        {
            string strSql;

            strSql  = "select fechabaja";
            strSql += " from dbo.Articulos where id = " + intCodigo;

            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            //if (dt != null)
            if (dt.Rows.Count > 0)
            {
                if (string.IsNullOrEmpty(dt.Rows[0]["fechabaja"].ToString()))
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 19
0
        public List <Contactos> BuscoContactos(int intCodigo)
        {
            string           strSql;
            Contactos        objContactos;
            List <Contactos> listContactos = new List <Contactos>();

            strSql  = "SELECT id,nombre,apellido,mail,puesto,observaciones ";
            strSql += "  FROM Contactos where prov_id =" + intCodigo;
            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    objContactos                = new Contactos();
                    objContactos.IntCodigo      = Convert.ToInt32(dt2.Rows[i]["id"].ToString());
                    objContactos.IntProveedor   = intCodigo;
                    objContactos.StrNombre      = dt2.Rows[i]["nombre"].ToString();
                    objContactos.StrApellido    = dt2.Rows[i]["apellido"].ToString();
                    objContactos.StrEmail       = dt2.Rows[i]["mail"].ToString();
                    objContactos.StrPuesto      = dt2.Rows[i]["puesto"].ToString();
                    objContactos.StrObservacion = dt2.Rows[i]["observaciones"].ToString();
                    objContactos.ListTelefonos  = BuscoTelefonosContactos(objContactos.IntCodigo);
                    listContactos.Add(objContactos);
                }
            }
            return(listContactos);
        }
Exemplo n.º 20
0
        public bool ExisteArticulo(string strCodigo)
        {
            string strSql;

            strSql  = "select count(*) as cantidad";
            strSql += " from dbo.Articulos where fechabaja is null and idextra ='" + strCodigo + "'";

            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            //if (dt != null)
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["cantidad"].ToString() == "0")
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 21
0
        public List <ArticulosPorDevolucion> BuscoArticulosxDevolucion(int intCodigo)
        {
            string strSql;
            ArticulosPorDevolucion        objArticulosPorDevolucion;
            List <ArticulosPorDevolucion> listArticulosPorDevolucion = new List <ArticulosPorDevolucion>();

            strSql  = "SELECT d.[detalleid],d.[articuloid],d.[cantidad],d.[puni],d.[total], a.idextra, a.descripcion ";
            strSql += " FROM Devoluciones_Detalle d, dbo.Articulos a where a.id=d.articuloid and d.devolucionid = " + intCodigo;

            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    objArticulosPorDevolucion                             = new ArticulosPorDevolucion();
                    objArticulosPorDevolucion.ObjArticulo                 = new Articulos();
                    objArticulosPorDevolucion.IntCodigo                   = Convert.ToInt32(dt2.Rows[i]["detalleid"].ToString());
                    objArticulosPorDevolucion.ObjArticulo.IntCodigo       = Convert.ToInt32(dt2.Rows[i]["articuloid"].ToString());
                    objArticulosPorDevolucion.ObjArticulo.StrCodigo       = dt2.Rows[i]["idextra"].ToString();
                    objArticulosPorDevolucion.ObjArticulo.StrDescripcion  = dt2.Rows[i]["descripcion"].ToString();
                    objArticulosPorDevolucion.IntCantidad                 = Convert.ToInt32(dt2.Rows[i]["cantidad"].ToString());
                    objArticulosPorDevolucion.DoPrecioUnitarioConEfectivo = Convert.ToDecimal(dt2.Rows[i]["puni"].ToString());
                    objArticulosPorDevolucion.DoTotalConEfectivo          = Convert.ToDecimal(dt2.Rows[i]["total"].ToString());
                    listArticulosPorDevolucion.Add(objArticulosPorDevolucion);
                }
            }
            return(listArticulosPorDevolucion);
        }
Exemplo n.º 22
0
        public bool ExisteMoneda(string strCodigo)
        {
            string strSql;

            strSql  = "select count(*) as cantidad";
            strSql += " from dbo.Monedas where monedaid =" + strCodigo;

            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            //if (dt != null)
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["cantidad"].ToString() == "0")
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 23
0
        public List <SubVentaCheque> BuscoChequesEnVenta(int intCodigo)
        {
            string                strSql;
            SubVentaCheque        objSubVentaCheque;
            List <SubVentaCheque> listChequesEnVenta = new List <SubVentaCheque>();

            strSql  = "select id,chequeabona, chequebanco,chequenumero,chequevenc ";
            strSql += " from dbo.Cheques_Detalle where facturaid = " + intCodigo;

            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    objSubVentaCheque                    = new SubVentaCheque();
                    objSubVentaCheque.IntCodigo          = Convert.ToInt32(dt2.Rows[i]["id"].ToString());
                    objSubVentaCheque.DoAbona            = Convert.ToDecimal(dt2.Rows[i]["chequeabona"].ToString());
                    objSubVentaCheque.StrBanco           = dt2.Rows[i]["chequebanco"].ToString();
                    objSubVentaCheque.StrNumero          = dt2.Rows[i]["chequenumero"].ToString();
                    objSubVentaCheque.DtFechaVencimiento = Convert.ToDateTime(dt2.Rows[i]["chequevenc"].ToString());
                    listChequesEnVenta.Add(objSubVentaCheque);
                }
            }
            return(listChequesEnVenta);
        }
Exemplo n.º 24
0
        public bool ValidaEsInicioDeCaja(int intNumeroCaja)
        {
            string strSql;


            strSql  = " select fecha_cierre from Cierre_caja where cierrecajaid in ( ";
            strSql += " select max(cierrecajaid) from Cierre_Caja where numero_caja = " + intNumeroCaja + " ) ";

            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);


            if (dt2 != null)
            {
                if (dt2.Rows.Count > 0)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 25
0
        public List <Seguimiento> BuscoSeguimiento(int intCodigo)
        {
            string             strSql;
            Seguimiento        objSeguimiento;
            List <Seguimiento> listSeguimiento = new List <Seguimiento>();

            strSql = "select * from Seguimiento s, Usuarios u where s.usuarioid = u.id and facturaid=" + intCodigo;
            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    objSeguimiento                = new Seguimiento();
                    objSeguimiento.IntCodigo      = Convert.ToInt32(dt2.Rows[i]["seguimientoid"].ToString());
                    objSeguimiento.IntFacturaID   = Convert.ToInt32(dt2.Rows[i]["facturaid"].ToString());
                    objSeguimiento.DtFecha        = Convert.ToDateTime(dt2.Rows[i]["fecha"].ToString());
                    objSeguimiento.IntUsuarioID   = Convert.ToInt32(dt2.Rows[i]["usuarioid"].ToString());
                    objSeguimiento.StrUsuario     = dt2.Rows[i]["usuario"].ToString();
                    objSeguimiento.StrEstadoDesde = dt2.Rows[i]["estadodesde"].ToString();
                    objSeguimiento.StrEstadoHasta = dt2.Rows[i]["estadohasta"].ToString();

                    listSeguimiento.Add(objSeguimiento);
                }
            }
            return(listSeguimiento);
        }
Exemplo n.º 26
0
        public bool ValidaCajaAbierta(int intNumeroCaja)
        {
            string strSql;
            string strFecha;

            strSql  = " select fecha_cierre from Cierre_caja where cierrecajaid in ( ";
            strSql += " select max(cierrecajaid) from Cierre_Caja where numero_caja = " + intNumeroCaja + " ) ";

            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                if (dt2.Rows.Count > 0)
                {
                    strFecha = dt2.Rows[0]["fecha_cierre"].ToString();
                    if (String.IsNullOrEmpty(strFecha))
                    {
                        return(true); //La Caja quedo Abierta
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 27
0
        public Clientes BuscarCliente(int intCodigo)
        {
            Clientes objClientes = new Clientes();
            string   strSql;

            strSql  = "select doc_id,cli_documento,cli_nombre,cli_apellido,cli_fdnac,cli_fding,cli_direccion,cli_depto,cli_piso,cli_nro,loc_id,prov_id,pais,cli_mail, predeterminado, fechabaja";
            strSql += " from dbo.Clientes where cli_id =" + intCodigo;
            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            objClientes.IntCodigo        = intCodigo;
            objClientes.IntDocumento     = Convert.ToInt32(dt.Rows[0]["doc_id"].ToString());
            objClientes.StrDocumento     = dt.Rows[0]["cli_documento"].ToString();
            objClientes.StrNombre        = dt.Rows[0]["cli_nombre"].ToString();
            objClientes.StrApellido      = dt.Rows[0]["cli_apellido"].ToString();
            objClientes.DtFechadeNac     = Convert.ToDateTime(dt.Rows[0]["cli_fdnac"].ToString());
            objClientes.DtFechadeIngreso = Convert.ToDateTime(dt.Rows[0]["cli_fding"].ToString());
            objClientes.StrDirecccion    = dt.Rows[0]["cli_direccion"].ToString();
            objClientes.StrDepto         = dt.Rows[0]["cli_depto"].ToString();
            objClientes.StrPiso          = dt.Rows[0]["cli_piso"].ToString();
            objClientes.StrNro           = dt.Rows[0]["cli_nro"].ToString();
            objClientes.IntLocalidad     = Convert.ToInt32(dt.Rows[0]["loc_id"].ToString());
            objClientes.IntProvincia     = Convert.ToInt32(dt.Rows[0]["prov_id"].ToString());
            objClientes.IntPais          = Convert.ToInt32(dt.Rows[0]["pais"].ToString());
            objClientes.StrEmail         = dt.Rows[0]["cli_mail"].ToString();
            objClientes.BoPredeterminado = Convert.ToBoolean(dt.Rows[0]["predeterminado"].ToString());
            objClientes.DtFechaBaja      = Convert.ToString(dt.Rows[0]["fechabaja"].ToString());

            objClientes.ListTelefonos = BuscoTelefonosCliente(objClientes.IntCodigo);

            return(objClientes);
        }
Exemplo n.º 28
0
        public Int32 getCierreCajaId(int intNumeroCaja)
        {
            string strSql;


            strSql  = " select cierrecajaid from Cierre_Caja";
            strSql += " where fecha_cierre is null and numero_caja = " + intNumeroCaja;

            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);


            if (dt2 != null)
            {
                if (dt2.Rows.Count > 0)
                {
                    return(Convert.ToInt32(dt2.Rows[0]["cierrecajaid"].ToString()));
                }
                else
                {
                    return(0);
                }
            }
            else
            {
                return(0);
            }
        }
Exemplo n.º 29
0
        public bool ClienteDadoDeBaja(int intCodigo)
        {
            Clientes objClientes = new Clientes();
            string   strSql;

            strSql  = "select  fechabaja";
            strSql += " from dbo.Clientes where cli_id =" + intCodigo;
            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            if (dt != null)
            {
                if (string.IsNullOrEmpty(dt.Rows[0]["fechabaja"].ToString()))
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 30
0
        public bool ExisteNumeroDeCaja(string strCodigo, string strNombrePc)
        {
            string strSql;

            strSql  = "select count(*) as cantidad";
            strSql += " from Configuraciones where numero_caja =" + strCodigo;
            strSql += " And nombre_pc not in ('" + strNombrePc + "')";

            LlenaCombos objLlenaCombos = new LlenaCombos();
            DataTable   dt             = objLlenaCombos.GetSqlDataAdapterbySql(strSql);

            //if (dt != null)
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["cantidad"].ToString() == "0")
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }