Example #1
0
        public IEnumerable<Core.Business.AREACODE> GetAllAREACODE()
        {
            IList<Core.Business.AREACODE> aREACODElist = new List<Core.Business.AREACODE>();
            ImportSqlServerUtility sql = new ImportSqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllAREACODE);

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.AREACODE aREACODE = new Core.Business.AREACODE();

                    if (!reader.IsDBNull(0)) aREACODE.PROVINCEID = reader.GetString(0);
                    if (!reader.IsDBNull(1)) aREACODE.PROVINCENAME = reader.GetString(1);
                    if (!reader.IsDBNull(2)) aREACODE.ProvinceAlias = reader.GetString(2);
                    if (!reader.IsDBNull(3)) aREACODE.CITYID = reader.GetString(3);
                    if (!reader.IsDBNull(4)) aREACODE.CITYNAME = reader.GetString(4);

                    aREACODE.MarkOld();
                    aREACODElist.Add(aREACODE);
                }
                reader.Close();
            }
            return aREACODElist;
        }
Example #2
0
        public IList<Core.Business.Rprovince> GetAllRprovince()
        {
            IList<Core.Business.Rprovince> rprovincelist = new List<Core.Business.Rprovince>();
            ImportSqlServerUtility sql = new ImportSqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllRprovince);

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.Rprovince rprovince = new Core.Business.Rprovince();

                    if (!reader.IsDBNull(0)) rprovince.NProcinceId = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) rprovince.OProvinceId = reader.GetString(1);

                    rprovince.MarkOld();
                    rprovincelist.Add(rprovince);
                }
                reader.Close();
            }
            return rprovincelist;
        }
Example #3
0
        public Core.Business.Rprovince Select(System.Int32 id)
        {
            ImportSqlServerUtility sql = new ImportSqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectRprovince);

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

                if (!reader.IsDBNull(0)) rprovince.NProcinceId = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) rprovince.OProvinceId = reader.GetString(1);

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

                return null;
            }
        }