public static juz getJuz(int Juz) { juz Data = null; if (Juz == 0) { return(new juz() { idx = 0, name = "All", ayahfrom = 1, surahfrom = 0, surahto = 114, ayahto = 6, arabic = "" }); } try { var connection = new SQLiteConnection(Conn); using (var context = new DataContext(connection)) { Data = (from a in context.GetTable <juz>() where a.idx == Juz select a).SingleOrDefault(); } connection.Close(); } catch { throw; } return(Data); }
public static List <surah> getSurahFromJuz(int Juz) { dynamic Data; try { var connection = new SQLiteConnection(Conn); using (var context = new DataContext(connection)) { juz selJuz = context.GetTable <juz>().Where(a => a.idx == Juz).SingleOrDefault(); Data = (from a in context.GetTable <surah>() where a.idx >= selJuz.surahfrom && a.idx <= selJuz.surahto select a).ToList(); } connection.Close(); } catch { throw; } return(Data); }