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