Ejemplo n.º 1
0
        public Double obtenerImporteCajaActual(DateTime fecha)
        {
            try
            {
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD con     = new ConectarBD();
                DataSet    Ds      = new DataSet();
                Double     importe = 0.00;
                String     sSQL    = "";

                sSQL = "EXEC dbo.ObtenerImporteCajaActual ";
                sSQL = sSQL + " @fecha_mov = " + fg.fcSql(fecha.ToString(), "DATETIME");
                Ds.Reset();
                Ds = con.ejecutarQuerySelect(sSQL);

                if (Ds.Tables[0].Rows.Count > 0)
                {
                    importe = Double.Parse(Ds.Tables[0].Rows[0]["TOTAL"].ToString());
                }

                return(importe);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 2
0
        //internal List<Venta> obtenerVentas(DateTime Fecha)
        internal DataSet obtenerVentas (DateTime Fecha)
        {
            try
            {
                String cadenaSql = "";
                DataSet Ds = new DataSet();
                ConectarBD objConect = new ConectarBD();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                
                //List<Venta> VentasDelDia = new List<Venta>();

                cadenaSql = "EXEC dbo.adp_obtener_ventas @d_16_fecha = " + fg.fcSql(Fecha.ToString(), "DATETIME");
                Ds = objConect.ejecutarQuerySelect(cadenaSql);

                return Ds;

                //foreach(DataRow dataRow in Ds.Tables[0].Rows)
                //{
                //    Venta venta = new Venta();
                //
                //    venta.id = Int32.Parse(dataRow["ID_VENTA"].ToString());
                //    venta.cantidad_Articulos = Int32.Parse(dataRow["CANTIDAD_ARTICULOS"].ToString());
                //    venta.importe = double.Parse(dataRow["IMPORTE"].ToString());
                //    venta.fecha_Venta = DateTime.Parse(dataRow["FECHA_VENTA"].ToString());
                //    venta.hora_Venta = dataRow["HORA_VENTA"].ToString();
                //
                //    VentasDelDia.Add(venta);
                //}
                //return VentasDelDia;
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 3
0
        internal int ObtenerId_TipoMovimiento(int Id_Movimiento)
        {
            try
            {
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD con = new ConectarBD();
                DataSet    Ds  = new DataSet();
                String     sSQL;
                int        ID;

                sSQL = "exec dbo.adp_obtenerId_TipoMovimientoCaja ";
                sSQL = sSQL + "  @ID_Movimiento = " + Id_Movimiento;

                Ds.Reset();
                Ds = con.ejecutarQuerySelect(sSQL);

                if (Ds.Tables[0].Rows.Count > 0)
                {
                    ID = int.Parse(Ds.Tables[0].Rows[0]["ID_TipoMovimiento"].ToString());
                }
                else
                {
                    throw new System.ArgumentException("Error al intentar obtener el ID tipo Movimiento Caja");
                }

                return(ID);
            }
            catch (Exception ex)
            {
                throw new System.ArgumentException(ex.Message.ToString());
            }
        }
Ejemplo n.º 4
0
Archivo: Caja.cs Proyecto: rrromano/BSP
        public Double obtenerCajaActual(DateTime fecha)
        {
            try
            {
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD con = new ConectarBD();
                DataSet Ds = new DataSet();
                Double importe = 0.00;
                String sSQL = "";

                sSQL = "EXEC dbo.adp_ObtenerCajaActual";
                sSQL = sSQL + " @fecha_mov = " + fg.fcSql(fecha.ToString(), "DATETIME");
                Ds.Reset();
                Ds = con.ejecutarQuerySelect(sSQL);

                if (Ds.Tables[0].Rows.Count > 0)
                {
                    importe = Double.Parse(Ds.Tables[0].Rows[0]["TOTAL"].ToString());
                }

                return importe;
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 5
0
        //internal List<Venta> obtenerVentas(DateTime Fecha)
        internal DataSet obtenerVentas(DateTime Fecha)
        {
            try
            {
                String     cadenaSql = "";
                DataSet    Ds        = new DataSet();
                ConectarBD objConect = new ConectarBD();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();

                //List<Venta> VentasDelDia = new List<Venta>();

                cadenaSql = "EXEC dbo.adp_obtener_ventas @d_16_fecha = " + fg.fcSql(Fecha.ToString(), "DATETIME");
                Ds        = objConect.ejecutarQuerySelect(cadenaSql);

                return(Ds);

                //foreach(DataRow dataRow in Ds.Tables[0].Rows)
                //{
                //    Venta venta = new Venta();
                //
                //    venta.id = Int32.Parse(dataRow["ID_VENTA"].ToString());
                //    venta.cantidad_Articulos = Int32.Parse(dataRow["CANTIDAD_ARTICULOS"].ToString());
                //    venta.importe = double.Parse(dataRow["IMPORTE"].ToString());
                //    venta.fecha_Venta = DateTime.Parse(dataRow["FECHA_VENTA"].ToString());
                //    venta.hora_Venta = dataRow["HORA_VENTA"].ToString();
                //
                //    VentasDelDia.Add(venta);
                //}
                //return VentasDelDia;
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 6
0
 internal void eliminarMovCajaPorFecha(DateTime fecha_mov)
 {
     try
     {
         FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
         ConectarBD Conex = new ConectarBD();
         String     sSQL  = "EXEC dbo.adp_eliminarTodosMovCajaDeHoy @fecha_mov = " + fg.fcSql(fecha_mov.ToString(), "DATETIME");
         Conex.ejecutarQuery(sSQL);
     }
     catch (Exception e)
     {
         throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
     }
 }
Ejemplo n.º 7
0
        public DataSet obtenerCierreParcialCaja(DateTime fecha)
        {
            try
            {
                ConectarBD con = new ConectarBD();
                DataSet    ds  = new DataSet();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                String cadenaSql = "";

                cadenaSql = "EXEC adp_cierre_parcial @FECHA = " + fg.fcSql(fecha.ToString(), "DATETIME");
                ds        = con.ejecutarQuerySelect(cadenaSql);
                return(ds);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 8
0
        public void registrarMovimientosCaja(DateTime Fecha, String Hora)
        {
            try
            {
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD con = new ConectarBD();
                String     sSQL;

                sSQL = "exec adp_registrar_movimientosCaja ";
                sSQL = sSQL + " @fecha = " + fg.fcSql(Fecha.ToString(), "DATETIME");
                sSQL = sSQL + ",@hora  = " + fg.fcSql(Hora, "STRING");
                con.ejecutarQuery(sSQL);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException(e.Message.ToString());
            }
        }
Ejemplo n.º 9
0
        public DataSet obtenerCamposTiposDeMovimientosCaja()
        {
            try
            {
                ConectarBD con = new ConectarBD();
                DataSet    ds  = new DataSet();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                String cadenaSql = "";

                cadenaSql = "EXEC adp_cbobusqueda_tipoMovimientos_caja";
                ds        = con.ejecutarQuerySelect(cadenaSql);
                return(ds);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 10
0
Archivo: Caja.cs Proyecto: rrromano/BSP
        public DataSet obtenerCamposMovimientosCaja()
        {
            try
            {
                ConectarBD con = new ConectarBD();
                DataSet ds = new DataSet();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                String cadenaSql = "";

                cadenaSql = "EXEC adp_cbobusqueda_movimientos_caja";
                ds = con.ejecutarQuerySelect(cadenaSql);
                return ds;
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 11
0
        public void modificarCajaInicial(DateTime Fecha, String Valor)
        {
            try
            {
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD con = new ConectarBD();
                String     sSQL;

                sSQL = "exec adp_modificarCajaInicial ";
                sSQL = sSQL + " @fecha = " + fg.fcSql(Fecha.ToString(), "DATETIME");
                sSQL = sSQL + " ,@Valor = " + fg.fcSql(Valor, "DOUBLE");
                con.ejecutarQuery(sSQL);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException(e.Message.ToString());
            }
        }
Ejemplo n.º 12
0
        public void modificarCajaInicial(DateTime Fecha,  String Valor)
        {
            try
            {
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD con = new ConectarBD();
                String sSQL;

                sSQL = "exec adp_modificarCajaInicial ";
                sSQL = sSQL + " @fecha = " + fg.fcSql(Fecha.ToString(), "DATETIME");
                sSQL = sSQL + " ,@Valor = " + fg.fcSql(Valor, "DOUBLE");
                con.ejecutarQuery(sSQL);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException(e.Message.ToString());
            }

        }
Ejemplo n.º 13
0
        internal DataSet obtenerTiposMovimientosCaja()
        {
            try
            {
                ConectarBD con = new ConectarBD();
                DataSet    Ds  = new DataSet();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();

                String sSQL = "";
                sSQL = "EXEC dbo.adp_obtenerTiposMovsCaja";
                Ds.Reset();
                Ds = con.ejecutarQuerySelect(sSQL);

                return(Ds);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 14
0
Archivo: Caja.cs Proyecto: furrutia/BSP
        public DataSet obtenerMovimientosCaja(DateTime fecha) 
        {
            try
            {
                ConectarBD con = new ConectarBD();
                DataSet Ds = new DataSet();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();

                String sSQL = "";
                sSQL = "EXEC dbo.adp_ObtenerMovimientosCaja @fecha_mov = " + fg.fcSql(fecha.ToString(),"DATETIME");
                Ds.Reset();
                Ds = con.ejecutarQuerySelect(sSQL);

                return Ds;
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 15
0
        public DataSet obtenerMovimientosCaja(DateTime fecha)
        {
            try
            {
                ConectarBD con = new ConectarBD();
                DataSet    Ds  = new DataSet();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();

                String sSQL = "";
                sSQL = "EXEC dbo.adp_ObtenerMovimientosCaja @fecha_mov = " + fg.fcSql(fecha.ToString(), "DATETIME");
                Ds.Reset();
                Ds = con.ejecutarQuerySelect(sSQL);

                return(Ds);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 16
0
        internal DataSet obtenerTiposMovimientosCaja()
        {
            try
            {
                ConectarBD con = new ConectarBD();
                DataSet Ds = new DataSet();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();

                String sSQL = "";
                sSQL = "EXEC dbo.adp_obtenerTiposMovsCaja";
                Ds.Reset();
                Ds = con.ejecutarQuerySelect(sSQL);

                return Ds;
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 17
0
        public void registrarMovimientoCaja(int tipoMovimiento, String descripcion, Double valor, DateTime fecha, String hora)
        {
            try
            {
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD con = new ConectarBD();
                String     sSQL;

                sSQL = "exec dbo.adp_registrar_mov_caja ";
                sSQL = sSQL + "  @Tipo_Movimiento = " + fg.fcSql(tipoMovimiento.ToString(), "STRING");
                sSQL = sSQL + " ,@Valor           = " + fg.fcSql(valor.ToString(), "DOUBLE").Replace(",", ".");
                sSQL = sSQL + " ,@fecha           = " + fg.fcSql(fecha.ToString(), "DATETIME");
                sSQL = sSQL + " ,@hora            = " + fg.fcSql(hora, "STRING");

                con.ejecutarQuery(sSQL);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException(e.Message.ToString());
            }
        }
Ejemplo n.º 18
0
 internal bool verificarExistenciaMovCajaSegunFecha(DateTime fecha_mov)
 {
     try
     {
         FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
         ConectarBD Conex = new ConectarBD();
         DataSet    Ds    = new DataSet();
         String     sSQL  = "EXEC dbo.adp_VerificoExistenciaMovCaja @fecha_mov = " + fg.fcSql(fecha_mov.ToString(), "DATETIME");
         Ds = Conex.ejecutarQuerySelect(sSQL);
         if (Ds.Tables[0].Rows.Count == 0)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
     }
 }
Ejemplo n.º 19
0
Archivo: Caja.cs Proyecto: furrutia/BSP
 internal void eliminarMovCajaPorFecha(DateTime fecha_mov)
 {
     try
     {
         FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
         ConectarBD Conex = new ConectarBD();
         String sSQL = "EXEC dbo.adp_eliminarTodosMovCajaDeHoy @fecha_mov = " + fg.fcSql(fecha_mov.ToString(), "DATETIME");
         Conex.ejecutarQuery(sSQL);
     }
     catch (Exception e)
     {
         throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
     }
 }
Ejemplo n.º 20
0
Archivo: Caja.cs Proyecto: rrromano/BSP
        internal void eliminarMovCajaPorFecha(DateTime fecha_mov)
        {
            try
            {
                string usuario = Properties.Settings.Default.UsuarioLogueado.ToString();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD Conex = new ConectarBD();
                String sSQL = "EXEC dbo.adp_eliminarTodosMovCajaDeHoy @fecha_mov = " + fg.fcSql(fecha_mov.ToString(), "DATETIME");
                if (usuario != "")
                { sSQL = sSQL + ",@Login = "******"String"); }

                Conex.ejecutarQuery(sSQL);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 21
0
        public DataSet obtenerGanancia(DateTime fechaDesde, DateTime fechaHasta)
        {
            try
            {
                ConectarBD con = new ConectarBD();
                DataSet ds = new DataSet();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                String cadenaSql = "";

                cadenaSql = "EXEC adp_obtener_ganancia @FECHA_DESDE = " + fg.fcSql(fechaDesde.ToString(), "DATETIME");
                cadenaSql = cadenaSql + ", @FECHA_HASTA = " + fg.fcSql(fechaHasta.ToString(), "DATETIME");
                ds = con.ejecutarQuerySelect(cadenaSql);
                return ds;
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 22
0
Archivo: Caja.cs Proyecto: furrutia/BSP
        public DataSet obtenerCierreParcialCaja(DateTime fecha)
        {
            try
            {
                ConectarBD con = new ConectarBD();
                DataSet ds = new DataSet();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                String cadenaSql = "";

                cadenaSql = "EXEC adp_cierre_parcial @FECHA = " + fg.fcSql(fecha.ToString(), "DATETIME");
                ds = con.ejecutarQuerySelect(cadenaSql);
                return ds;
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
            }
        }
Ejemplo n.º 23
0
        public void registrarMovimientosCaja(DateTime Fecha, String Hora)
        {
            try
            {
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD con = new ConectarBD();
                String sSQL;

                sSQL = "exec adp_registrar_movimientosCaja ";
                sSQL = sSQL + " @fecha = " + fg.fcSql(Fecha.ToString(), "DATETIME");
                sSQL = sSQL + ",@hora  = " + fg.fcSql(Hora, "STRING");
                con.ejecutarQuery(sSQL);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException(e.Message.ToString());
            }


        }
Ejemplo n.º 24
0
Archivo: Caja.cs Proyecto: furrutia/BSP
 internal bool verificarExistenciaMovCajaSegunFecha(DateTime fecha_mov)
 {
     try
     {
         FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
         ConectarBD Conex = new ConectarBD();
         DataSet Ds = new DataSet();
         String sSQL = "EXEC dbo.adp_VerificoExistenciaMovCaja @fecha_mov = " + fg.fcSql(fecha_mov.ToString(),"DATETIME");
         Ds = Conex.ejecutarQuerySelect(sSQL);
         if (Ds.Tables[0].Rows.Count == 0) { return false; } else { return true; }
     }
     catch (Exception e)
     {
         throw new System.ArgumentException("[Error] - [" + e.Message.ToString() + "]");
     }
 }
Ejemplo n.º 25
0
        public void registrarMovimientoCaja(int tipoMovimiento, String descripcion, Double valor, DateTime fecha, String hora)
        {
            try
            {
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD con = new ConectarBD();
                String sSQL;

                sSQL = "exec dbo.adp_registrar_mov_caja ";
                sSQL = sSQL + "  @Tipo_Movimiento = " + fg.fcSql(tipoMovimiento.ToString(), "STRING");
                sSQL = sSQL + " ,@Valor           = " + fg.fcSql(valor.ToString(), "DOUBLE").Replace(",", ".");
                sSQL = sSQL + " ,@fecha           = " + fg.fcSql(fecha.ToString(), "DATETIME");
                sSQL = sSQL + " ,@hora            = " + fg.fcSql(hora, "STRING");

                con.ejecutarQuery(sSQL);
            }
            catch (Exception e)
            {
                throw new System.ArgumentException(e.Message.ToString());
            }

        }
Ejemplo n.º 26
0
        internal int ObtenerId_TipoMovimiento(int Id_Movimiento)
        {
            try
            {
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                ConectarBD con = new ConectarBD();
                DataSet Ds = new DataSet();
                String sSQL;
                int ID;

                sSQL = "exec dbo.adp_obtenerId_TipoMovimientoCaja ";
                sSQL = sSQL + "  @ID_Movimiento = " + Id_Movimiento;

                Ds.Reset();
                Ds = con.ejecutarQuerySelect(sSQL);

                if (Ds.Tables[0].Rows.Count > 0)
                {
                    ID = int.Parse(Ds.Tables[0].Rows[0]["ID_TipoMovimiento"].ToString());
                }
                else
                {
                    throw new System.ArgumentException("Error al intentar obtener el ID tipo Movimiento Caja");
                }

                return ID;
            }
            catch (Exception ex)
            {
                throw new System.ArgumentException(ex.Message.ToString());
            }
        }