private void btnAd_Click(object sender, EventArgs e) { CityModel newBrandModel = new CityModel(); using (AddUpdateCityFrm newBrand = new AddUpdateCityFrm(MaintainType.New, newBrandModel)) { var dialogResult = newBrand.ShowDialog(); if (dialogResult == DialogResult.OK) { InitControls(); } } }
private void btnUp_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count > 0) { var brand = this.dataGridView1.SelectedRows[0].Tag as CityModel; using (AddUpdateCityFrm modify = new AddUpdateCityFrm(MaintainType.Update, brand)) { var dialogResult = modify.ShowDialog(); if (dialogResult == DialogResult.OK) { InitControls(); } } } }