Ejemplo n.º 1
0
        private static Country GetCountryFromReader(IDataReader dataReader)
        {
            Country country = new Country();
            country.CountryID = DBHelper.GetGuid(dataReader, "CountryID");
            country.Name = DBHelper.GetString(dataReader, "Name");

            return country;
        }
Ejemplo n.º 2
0
 public Address(Guid addressid, Country country, City city, string street, string zipcode, string housenr)
 {
     this.addressid= addressid;
     this.country= country;
     this.city= city;
     this.street= street;
     this.zipcode= zipcode;
     this.housenr= housenr;
 }
Ejemplo n.º 3
0
        public static void UpdateCountry(Country country)
        {
            string sqlQuery = "UPDATE Country SET Name=@Name WHERE CountryID='" + country.CountryID+"'";

            DbCommand dbCommand = DBHelper.GetDBCommand(sqlQuery);
            DBHelper.AddInParameter(dbCommand, "Name", DbType.String, country.Name);

            DBHelper.ExecuteNonQuery(dbCommand);
        }
Ejemplo n.º 4
0
        public static Country InsertCountry(Country country)
        {
            string sqlQuery = "INSERT INTO Country(CountryID,Name) " +
                " VALUES(@CountryID,@Name)";

            DbCommand dbCommand = DBHelper.GetDBCommand(sqlQuery);
            DBHelper.AddInParameter(dbCommand, "CountryID", DbType.Guid, country.CountryID);
            DBHelper.AddInParameter(dbCommand, "Name", DbType.String, country.Name);

            return country;
        }
Ejemplo n.º 5
0
 public static void UpdateCountry(Country country)
 {
     CountryDB.UpdateCountry(country);
 }
Ejemplo n.º 6
0
 public static Country InsertCountry(Country country)
 {
     return CountryDB.InsertCountry(country);
 }