Exemple #1
0
        public IList<Core.Business.RCity> GetAllRCity()
        {
            IList<Core.Business.RCity> rCitylist = new List<Core.Business.RCity>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllRCity);

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.RCity rCity = new Core.Business.RCity();

                    if (!reader.IsDBNull(0)) rCity.NCityId = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) rCity.OCityId = reader.GetString(1);

                    rCity.MarkOld();
                    rCitylist.Add(rCity);
                }
                reader.Close();
            }
            return rCitylist;
        }
Exemple #2
0
        public Core.Business.RCity Select(System.Int32 id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectRCity);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.RCity rCity = new Core.Business.RCity();

                if (!reader.IsDBNull(0)) rCity.NCityId = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) rCity.OCityId = reader.GetString(1);

                reader.Close();
                return rCity;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }