public Perron GetPerronbyId(long id) { string sql = "Select * from Perron where id=@id"; List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("id", id.ToString()) }; DataSet results = ExecuteSql(sql, parameters); Perron p = null; if (results != null && results.Tables[0].Rows.Count > 0) { p = DataSetParser.DataSetToPerron(results, 0); } return(p); }
public List <Perron> GetAllPerrons() { string sql = "Select * from Perron "; List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >(); DataSet results = ExecuteSql(sql, parameters); List <Perron> perrons = new List <Perron>(); if (results != null) { for (int x = 0; x < results.Tables[0].Rows.Count; x++) { Perron p = DataSetParser.DataSetToPerron(results, x); perrons.Add(p); } } return(perrons); }
public List <Perron> GetAllPerronsbyStationId(long stationId) { string sql = "Select * from Perron where stationId = @stationId"; List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("stationId", stationId.ToString()) }; DataSet results = ExecuteSql(sql, parameters); List <Perron> perrons = new List <Perron>(); if (results != null) { for (int x = 0; x < results.Tables[0].Rows.Count; x++) { Perron p = DataSetParser.DataSetToPerron(results, x); perrons.Add(p); } } return(perrons); }