private void btnAd_Click(object sender, EventArgs e) { ExLogisticModel newBrandModel = new ExLogisticModel(); using (AddUpdateExFrm newBrand = new AddUpdateExFrm(MaintainType.New, newBrandModel)) { var dialogResult = newBrand.ShowDialog(); if (dialogResult == DialogResult.OK) { InitControls(); } } }
public AddUpdateExFrm(MaintainType type, ExLogisticModel model) { InitializeComponent(); this.maintainType = type; if (this.maintainType == MaintainType.New) { this.exModel = new ExLogisticModel(); } else { this.exModel = model; } InitControls(); }