Exemplo n.º 1
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.º 2
0
        public static void UpdateCity(City city)
        {
            string sqlQuery = "UPDATE City SET Name=@Name WHERE CityID='" + city.CityID+"'";

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

            DBHelper.ExecuteNonQuery(dbCommand);
        }
Exemplo n.º 3
0
        public static City InsertCity(City city)
        {
            string sqlQuery = "INSERT INTO City(CityID,Name) " +
                " VALUES(@CityID,@Name)";
            if (city.CityID == Guid.Empty)
                city.CityID = Guid.NewGuid();
            else
                return null;
            DbCommand dbCommand = DBHelper.GetDBCommand(sqlQuery);
            DBHelper.AddInParameter(dbCommand, "CityID", DbType.Guid, city.CityID);
            DBHelper.AddInParameter(dbCommand, "Name", DbType.String, city.Name);

            return city;
        }
Exemplo n.º 4
0
        private static City GetCityFromReader(IDataReader dataReader)
        {
            City city = new City();
            city.CityID = DBHelper.GetGuid(dataReader, "CityID");
            city.Name = DBHelper.GetString(dataReader, "Name");

            return city;
        }
Exemplo n.º 5
0
 public static City InsertCity(City city)
 {
     return CityDB.InsertCity(city);
 }