示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }