Exemple #1
0
 public void postPostalPlace(PostalPlace PostalPlace)
 {
     AddPostalPlaceForQuerry(
         "insert into poststed(poststed, postnr) values(@PostalPlace.PostalPlace, @PostalPlace.PostalNumber);",
         PostalPlace
         );
 }
Exemple #2
0
 public void UpdatePostalPlace(int id, PostalPlace PostalPlace)
 {
     AddPostalPlaceForQuerry(
         "update poststed set [email protected] where postnr=" + id.ToString() + ";",
         PostalPlace
         );
 }
Exemple #3
0
 private void AddPostalPlaceForQuerry(string command, PostalPlace PostalPlace)
 {
     using (MySqlConnection conn = new MySqlConnection(ConnectionString))
     {
         conn.Open();
         MySqlCommand cmd = conn.CreateCommand();
         cmd.CommandText = command;
         cmd.Parameters.AddWithValue("@PostalPlace.PostalPlace", PostalPlace.PostPlace);
         cmd.Parameters.AddWithValue("@PostalPlace.PostalNumber", PostalPlace.PostalNumber);
         cmd.ExecuteNonQuery();
         conn.Close();
     }
 }