Exemple #1
0
        public static IEnumerable <OrderVive> GetAllVive()
        {
            var           commandString = "Select * from OrderVives ";
            SQLiteCommand getAllCommand = new SQLiteCommand(commandString, connection);

            connection.Open();
            var reader = getAllCommand.ExecuteReader();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    var orderVive_Id = reader.GetInt32(0);
                    var countCars    = reader.GetInt32(1);
                    var name         = reader.GetString(2);
                    var radioVive    = reader.GetString(3);
                    var orderVive    = new OrderVive
                    {
                        OrderVive_Id = orderVive_Id,
                        CountCars    = countCars,
                        Name         = name,
                        RadioVive    = radioVive
                    };
                    yield return(orderVive);
                }
            }
            ;
            connection.Close();
        }
Exemple #2
0
        public static IEnumerable <OrderVive> GetAl()
        {
            var           commandString = "Select  SUM (CountCars) from OrderVives";
            SQLiteCommand getAllCommand = new SQLiteCommand(commandString, connection);

            connection.Open();
            var reader = getAllCommand.ExecuteReader();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    var countCars = reader.GetInt32(0);
                    var orderVive = new OrderVive
                    {
                        CountCars = countCars,
                    };
                    yield return(orderVive);
                }
            }
            ;
            connection.Close();
        }