コード例 #1
0
        public static List <basvuru> GetItems()
        {
            string           commandText = "select * from Table_Basvuru";
            SQLiteDataReader rdr         = DatabaseOperations.GetItems(commandText);

            List <basvuru> basvurus = new List <basvuru>();
            int            id, bitti, arsiv;
            string         isim, kayit, son, sonuc, link, baslangic, degisim, hash;

            while (rdr.Read())
            {
                id        = Convert.ToInt32(rdr["id"]);
                isim      = rdr["isim"].ToString();
                kayit     = rdr["kayit"].ToString();
                son       = rdr["son"].ToString();
                sonuc     = rdr["sonuc"].ToString();
                link      = rdr["link"].ToString();
                bitti     = Convert.ToInt32(rdr["bitti"]);
                baslangic = rdr["baslangic"].ToString();
                degisim   = rdr["degisim"].ToString();
                arsiv     = Convert.ToInt32(rdr["arsiv"]);
                hash      = rdr["hash"].ToString();

                basvuru item = new basvuru(id, isim, kayit, son, sonuc, link, bitti, baslangic, degisim, arsiv, hash);
                basvurus.Add(item);
            }
            return(basvurus);
        }
コード例 #2
0
        public static List <kitap> GetItems()
        {
            string           commandText = "select * from Table_Kitap";
            SQLiteDataReader rdr         = DatabaseOperations.GetItems(commandText);

            List <kitap> kitaps = new List <kitap>();
            int          id, bitti, sayfa;
            string       isim, link, baslangic, degisim;

            while (rdr.Read())
            {
                id        = Convert.ToInt32(rdr["id"]);
                isim      = rdr["isim"].ToString();
                sayfa     = Convert.ToInt16(rdr["sayfa"]);
                link      = rdr["link"].ToString();
                baslangic = rdr["baslangic"].ToString();
                degisim   = rdr["degisim"].ToString();
                try
                {
                    bitti = Convert.ToInt32(rdr["bitti"]);
                }
                catch (Exception) { bitti = 0; }

                kitap item = new kitap(id, isim, sayfa, link, bitti, baslangic, degisim);
                kitaps.Add(item);
            }
            return(kitaps);
        }