private void gridMain_CellDoubleClick(object sender, UI.ODGridClickEventArgs e) { SelectedPlan = (DiscountPlan)gridMain.ListGridRows[gridMain.GetSelectedIndex()].Tag; if (IsSelectionMode) { DialogResult = DialogResult.OK; return; } FormDiscountPlanEdit FormDPE = new FormDiscountPlanEdit(); FormDPE.DiscountPlanCur = SelectedPlan.Copy(); if (FormDPE.ShowDialog() == DialogResult.OK) { FillGrid(); } }
private void butAdd_Click(object sender, EventArgs e) { if (!Security.IsAuthorized(Permissions.InsPlanEdit)) { return; } DiscountPlan discountPlan = new DiscountPlan(); discountPlan.IsNew = true; FormDiscountPlanEdit FormDPE = new FormDiscountPlanEdit(); FormDPE.DiscountPlanCur = discountPlan; if (FormDPE.ShowDialog() == DialogResult.OK) { SelectedPlan = discountPlan; FillGrid(); } }