private static Country GetCountryFromReader(IDataReader dataReader) { Country country = new Country(); country.CountryID = DBHelper.GetGuid(dataReader, "CountryID"); country.Name = DBHelper.GetString(dataReader, "Name"); return country; }
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; }
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); }
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; }
public static void UpdateCountry(Country country) { CountryDB.UpdateCountry(country); }
public static Country InsertCountry(Country country) { return CountryDB.InsertCountry(country); }