Exemplo 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;
        }
Exemplo 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;
 }
Exemplo 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);
        }
Exemplo 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;
        }
Exemplo n.º 5
0
 public static void UpdateCountry(Country country)
 {
     CountryDB.UpdateCountry(country);
 }
Exemplo n.º 6
0
 public static Country InsertCountry(Country country)
 {
     return CountryDB.InsertCountry(country);
 }