示例#1
0
文件: Datos.cs 项目: jornic/Farmacia
        public void GraficoVentas(List <String> Product, List <string> Cantidad, string Init_Fecha, string Final_Fecha)
        {
            Conectar();
            try
            {
                Command = new SQLiteCommand("Select Distinct Producto From Venta Where Fecha_de_Venta Between '" + Init_Fecha + "' And '" + Final_Fecha + "'", Cadena);

                Reader = Command.ExecuteReader();

                while (Reader.Read())
                {
                    Product.Add(Reader["Producto"].ToString());
                }
                Cadena.Close();
                Conectar();

                foreach (string p in Product)
                {
                    Command = new SQLiteCommand("Select Sum(Cantidad) As Cantidad From Venta Where Fecha_de_Venta Between '" + Init_Fecha + "' And '" + Final_Fecha + "' And Producto= '" + p + "'", Cadena);

                    Reader = Command.ExecuteReader();

                    while (Reader.Read())
                    {
                        Cantidad.Add(Reader["Cantidad"].ToString());
                    }
                }
            }
            catch (SQLiteException Ex)
            {
                Console.WriteLine(Ex.Message);
            }
            Cadena.Close();
        }
示例#2
0
文件: Datos.cs 项目: jornic/Farmacia
        public void GraficoInventario(List <String> Product, List <string> Cantidad, string Init_Fecha, string Final_Fecha)
        {
            Conectar();
            try
            {
                Command = new SQLiteCommand("Select Producto,Cantidad From Inventario Where Fecha_Compra Between '" + Init_Fecha + "' And '" + Final_Fecha + "'", Cadena);
                SQLiteDataReader GReader = Command.ExecuteReader();

                while (GReader.Read())
                {
                    Product.Add(GReader["Producto"].ToString());
                    Cantidad.Add(GReader["Cantidad"].ToString());
                }
                Cadena.Close();
            }catch (SQLiteException Ex)
            {
                Console.WriteLine(Ex.Message);
            }
            Cadena.Close();
        }
示例#3
0
文件: Datos.cs 项目: jornic/Farmacia
        public DataTable TablaVentas(string Init_Fecha, string Final_Fecha)
        {
            Conectar();
            try
            {
                Adacter = new SQLiteDataAdapter("Select * From Venta Where Fecha_de_Venta Between '" + Init_Fecha + "' And '" + Final_Fecha + "'", Cadena);

                Tabla = new DataTable();

                Adacter.Fill(Tabla);

                Cadena.Close();

                return(Tabla);
            }
            catch (SQLiteException Ex)
            {
                Console.WriteLine(Ex.Message);
            }
            Cadena.Close();
            return(null);
        }