Beispiel #1
0
 public CountryRegion GetByID(string _countryRegionCode)
 {
     CountryRegionDAC _countryRegionComponent = new CountryRegionDAC();
      IDataReader reader = _countryRegionComponent.GetByIDCountryRegion(_countryRegionCode);
      CountryRegion _countryRegion = null;
      while(reader.Read())
      {
          _countryRegion = new CountryRegion();
          if(reader["CountryRegionCode"] != DBNull.Value)
              _countryRegion.CountryRegionCode = Convert.ToString(reader["CountryRegionCode"]);
          if(reader["Name"] != DBNull.Value)
              _countryRegion.Name = Convert.ToString(reader["Name"]);
          if(reader["ModifiedDate"] != DBNull.Value)
              _countryRegion.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _countryRegion.NewRecord = false;             }             reader.Close();
      return _countryRegion;
 }
Beispiel #2
0
 public List<CountryRegion> GetAll()
 {
     CountryRegionDAC _countryRegionComponent = new CountryRegionDAC();
      IDataReader reader =  _countryRegionComponent.GetAllCountryRegion().CreateDataReader();
      List<CountryRegion> _countryRegionList = new List<CountryRegion>();
      while(reader.Read())
      {
      if(_countryRegionList == null)
          _countryRegionList = new List<CountryRegion>();
          CountryRegion _countryRegion = new CountryRegion();
          if(reader["CountryRegionCode"] != DBNull.Value)
              _countryRegion.CountryRegionCode = Convert.ToString(reader["CountryRegionCode"]);
          if(reader["Name"] != DBNull.Value)
              _countryRegion.Name = Convert.ToString(reader["Name"]);
          if(reader["ModifiedDate"] != DBNull.Value)
              _countryRegion.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _countryRegion.NewRecord = false;
      _countryRegionList.Add(_countryRegion);
      }             reader.Close();
      return _countryRegionList;
 }
Beispiel #3
0
 public bool Update(CountryRegion countryregion ,string old_countryRegionCode)
 {
     CountryRegionDAC countryregionComponent = new CountryRegionDAC();
     return countryregionComponent.UpdateCountryRegion( countryregion.CountryRegionCode,  countryregion.Name,  countryregion.ModifiedDate,  old_countryRegionCode);
 }
Beispiel #4
0
 public bool Insert(CountryRegion countryregion)
 {
     CountryRegionDAC countryregionComponent = new CountryRegionDAC();
     return countryregionComponent.InsertNewCountryRegion( countryregion.CountryRegionCode,  countryregion.Name,  countryregion.ModifiedDate);
 }