Beispiel #1
0
 private void GetGeoCountry(string countryISOCode2)
 {
     using (IDataReader reader = DBGeoCountry.GetByISOCode2(countryISOCode2))
     {
         GetGeoCountry(reader);
     }
 }
Beispiel #2
0
 private void GetGeoCountry(Guid guid)
 {
     using (IDataReader reader = DBGeoCountry.GetOne(guid))
     {
         GetGeoCountry(reader);
     }
 }
Beispiel #3
0
 private bool Update()
 {
     return(DBGeoCountry.Update(
                this.guid,
                this.name,
                this.iSOCode2,
                this.iSOCode3));
 }
Beispiel #4
0
        private bool Create()
        {
            Guid newID = Guid.NewGuid();

            this.guid = newID;

            int rowsAffected = DBGeoCountry.Create(
                this.guid,
                this.name,
                this.iSOCode2,
                this.iSOCode3);

            return(rowsAffected > 0);
        }
Beispiel #5
0
        public static List <GeoCountry> GetPage(
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            List <GeoCountry> geoCountryCollection
                = new List <GeoCountry>();

            using (IDataReader reader = DBGeoCountry.GetPage(pageNumber, pageSize, out totalPages))
            {
                while (reader.Read())
                {
                    GeoCountry geoCountry = new GeoCountry();
                    geoCountry.guid     = new Guid(reader["Guid"].ToString());
                    geoCountry.name     = reader["Name"].ToString();
                    geoCountry.iSOCode2 = reader["ISOCode2"].ToString();
                    geoCountry.iSOCode3 = reader["ISOCode3"].ToString();
                    geoCountryCollection.Add(geoCountry);
                    //totalPages = Convert.ToInt32(reader["TotalPages"]);
                }
            }

            return(geoCountryCollection);
        }
Beispiel #6
0
        public static DataTable GetList()
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("Guid", typeof(Guid));
            dataTable.Columns.Add("Name", typeof(String));
            dataTable.Columns.Add("ISOCode2", typeof(String));
            dataTable.Columns.Add("ISOCode3", typeof(String));

            using (IDataReader reader = DBGeoCountry.GetAll())
            {
                while (reader.Read())
                {
                    DataRow row = dataTable.NewRow();
                    row["Guid"]     = reader["Guid"];
                    row["Name"]     = reader["Name"].ToString();
                    row["ISOCode2"] = reader["ISOCode2"].ToString();
                    row["ISOCode3"] = reader["ISOCode3"].ToString();
                    dataTable.Rows.Add(row);
                }
            }

            return(dataTable);
        }
Beispiel #7
0
 public static IDataReader GetAllGeoCountry()
 {
     return(DBGeoCountry.GetAll());
 }
Beispiel #8
0
 public static bool Delete(Guid guid)
 {
     return(DBGeoCountry.Delete(guid));
 }