public static bool IsDuplicate(NewsEntry entry) { using (DAC dac = new DAC()) { string query = string.Format("SELECT Title FROM News WHERE Provider = '{0}' AND Title = '{1}' AND EmailId = '{2}';", entry.Provider, entry.Title, entry.EmailId); using (DbDataReader reader = dac.FetchRecords(query)) { return(reader.HasRows); } } }
public static List <Recipe> FetchByGroupUid(long groupUid) { List <Recipe> recipeList = new List <Recipe>(); using (DAC dac = new DAC()) { using (DbDataReader reader = dac.FetchRecords("SELECT * FROM Recipe WHERE GroupUID = " + groupUid + ";")) { while (reader.Read()) { recipeList.Add(Fetch(reader)); } } } return(recipeList); }
public static List <Position> FetchAll() { List <Position> all = new List <Position>(); using (DAC dac = new DAC()) { using (DbDataReader reader = dac.FetchRecords("SELECT * FROM Location;")) { while (reader.Read()) { all.Add(Fetch(reader)); } } } return(all); }
public static List <RecipeGroup> FetchAll() { List <RecipeGroup> all = new List <RecipeGroup>(); using (DAC dac = new DAC()) { using (DbDataReader reader = dac.FetchRecords("SELECT * FROM RecipeGroup ORDER BY UID;")) { while (reader.Read()) { all.Add(Fetch(reader)); } } } return(all); }
public static RecipeGroup FetchByUid(int uid) { RecipeGroup group = null; using (DAC dac = new DAC()) { using (DbDataReader reader = dac.FetchRecords("SELECT * FROM RecipeGrou] WHERE UID = " + uid + ";")) { if (reader.Read()) { group = Fetch(reader); } } } return(group); }
public static List <NewsEntry> FetchAll() { List <NewsEntry> all = new List <NewsEntry>(); using (DAC dac = new DAC()) { using (DbDataReader reader = dac.FetchRecords("SELECT * FROM News;")) { while (reader.Read()) { all.Add(Fetch(reader)); } } } return(all); }