예제 #1
0
파일: Address.cs 프로젝트: tsubik/SFASystem
 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;
 }
예제 #2
0
파일: CityDB.cs 프로젝트: tsubik/SFASystem
        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);
        }
예제 #3
0
파일: CityDB.cs 프로젝트: tsubik/SFASystem
        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;
        }
예제 #4
0
파일: CityDB.cs 프로젝트: tsubik/SFASystem
        private static City GetCityFromReader(IDataReader dataReader)
        {
            City city = new City();
            city.CityID = DBHelper.GetGuid(dataReader, "CityID");
            city.Name = DBHelper.GetString(dataReader, "Name");

            return city;
        }
예제 #5
0
 public static City InsertCity(City city)
 {
     return CityDB.InsertCity(city);
 }