public Gerecht GetGerechtById(int id) { string sql = "select * from Gerecht where GerechtID = @ID"; Dictionary <object, object> parameters = new Dictionary <object, object>(); parameters.Add("ID", id); int x = 0; DataSet ds = GetDataSetSql(sql, parameters); Gerecht g = DataSetParser.DataSetToGerecht(ds, x); return(g); }
public Gerecht GetGerechtByRondeAndGerechtIdAndOrderId(int ronde, int GerechtId, int OrderId) { string sql = "Select * From Gerecht Where GerechtId = (Select GerechtId From GerechtOrder where Ronde = @ronde And GerechtID = @id and OrderId = @OrderId)"; Dictionary <object, object> parameters = new Dictionary <object, object>(); parameters.Add("ronde", ronde); parameters.Add("id", GerechtId); parameters.Add("OrderId", OrderId); DataSet set = GetDataSetSql(sql, parameters); Gerecht g = null; if (set != null && set.Tables[0].Rows.Count >= 1) { g = DataSetParser.DataSetToGerecht(set, 0); } return(g); }
public List <Gerecht> GetAllGerechtenFromRestaurantID(int id) { string sql = "select * from Gerecht where RestaurantID = @Id"; Dictionary <object, object> parameters = new Dictionary <object, object>(); parameters.Add("Id", id); List <Gerecht> gerechten = new List <Gerecht>(); DataSet set = GetDataSetSql(sql, parameters); if (set != null && set.Tables[0].Rows.Count >= 1) { for (int x = 0; x < set.Tables[0].Rows.Count; x++) { gerechten.Add(DataSetParser.DataSetToGerecht(set, x)); } } else { return(null); } return(gerechten); }