示例#1
0
        private void buttonToAddPlace_Click(object sender, EventArgs e)
        {
            string name      = textBoxPlaceName.Text;
            string postalNum = textBoxPlaceNum.Text;

            if (postalNum.Length == 4)
            {
                Places addPlace = new Places(name, postalNum);
                db.addPlace(addPlace);
                //MessageBox.Show(name + postalNum);
            }
            else
            {
                MessageBox.Show("Postal number must not be longer than 4 numbers.");
            }
        }