Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public bool Update(string CountryRegionCode, string Name, string Original_CountryRegionCode)
        {
            CountryRegionDAC countryregionComponent = new CountryRegionDAC();

            return(countryregionComponent.UpdateCountryRegion(CountryRegionCode, Name, DateTime.Today, Original_CountryRegionCode));
        }
Ejemplo n.º 4
0
        public bool Update(CountryRegion countryregion, string old_countryRegionCode)
        {
            CountryRegionDAC countryregionComponent = new CountryRegionDAC();

            return(countryregionComponent.UpdateCountryRegion(countryregion.CountryRegionCode, countryregion.Name, countryregion.ModifiedDate, old_countryRegionCode));
        }
Ejemplo n.º 5
0
        public bool Insert(string CountryRegionCode, string Name)
        {
            CountryRegionDAC countryregionComponent = new CountryRegionDAC();

            return(countryregionComponent.InsertNewCountryRegion(CountryRegionCode, Name, DateTime.Today));
        }
Ejemplo n.º 6
0
        public bool Insert(CountryRegion countryregion)
        {
            CountryRegionDAC countryregionComponent = new CountryRegionDAC();

            return(countryregionComponent.InsertNewCountryRegion(countryregion.CountryRegionCode, countryregion.Name, countryregion.ModifiedDate));
        }
Ejemplo n.º 7
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            CountryRegionDAC countryregioncomponent = new CountryRegionDAC();

            return(countryregioncomponent.UpdateDataset(dataset));
        }
Ejemplo n.º 8
0
        public void Delete(string Original_CountryRegionCode)
        {
            CountryRegionDAC countryregionComponent = new CountryRegionDAC();

            countryregionComponent.DeleteCountryRegion(Original_CountryRegionCode);
        }