private void addCityToFormManagerButton_Click(object sender, EventArgs e) { try { CityTable newCity = new CityTable(); newCity.CityName = CityTextBox.Text; newCity.Id = Convert.ToInt64(IDTextBox.Text); SqlManipulator sql = new SqlManipulator(); if (sql.addCity(newCity)) { makeTable(sql.getDataCity()); MessageBox.Show("با موفقیت شهر مورد نظر اضافه گردید"); mainForm.setCityComboBox(); } else { MessageBox.Show("خطا"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }