Пример #1
0
        public static List <Casopis> DohvatiSve()
        {
            List <Casopis> listaCasopisa = new List <Casopis>();

            BP.otvoriKonekciju();

            SqliteCommand command = BP.komanda();

            command.CommandText = "Select * from casopis, sadrzaj where casopis.id_sadrzaj = sadrzaj.id";

            SqliteDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                Casopis k = new Casopis();

                k.Id     = (int)(Int64)reader["id"];
                k.Naziv  = (string)reader["naziv"];
                k.Tagovi = (string)reader["tagovi"];

                listaCasopisa.Add(k);
            }

            reader.Dispose();
            command.Dispose();

            return(listaCasopisa);
        }
Пример #2
0
		public static List<Knjiga> DohvatiSve()
		{
			List<Film> listaFilmova = new List<Knjiga>();

			BP.otvoriKonekciju();

			SqliteCommand command = BP.komanda();

			command.CommandText = "Select * from film, sadrzaj where film.id_sadrzaj = sadrzaj.id";

			SqliteDataReader reader = command.ExecuteReader();

			while (reader.Read())
			{
				Film k = new Film();

				k.Id = (int)(Int64)reader["id"];
				k.Naziv = (string)reader["naziv"];
				k.Tagovi = (string)reader["tagovi"];

				listaFilmova.Add(k);
			}

			reader.Dispose();
			command.Dispose();

			return listaFilmova;
	}
Пример #3
0
        public static void Spremi(Casopis k)
        {
            BP.otvoriKonekciju();

            SqliteCommand command = BP.komanda();

            command.CommandText = @"create table if not exist Casopis (

			id integer primary key autoincrement,
			naziv string,
			tagovi string)"            ;
        }
Пример #4
0
		public static void Spremi(Film k)
		{
			BP.otvoriKonekciju();

			SqliteCommand command = BP.komanda();
			command.CommandText = @"create table if not exist film (

			id integer primary key autoincrement,
			godina DateTime,
			naziv string,
			trajanje integer,
			cijena double,
			tagovi string,
			opis string)"; 

		}