private void AddSubscription() { SubscriptionForm form = new SubscriptionForm(); if (form.ShowDialog(this) == DialogResult.OK) { Subscription subscription = new Subscription { NameService = form.NameService, Description = form.Description }; logic.AddSubscription(subscription); UpdateSubscriptionsGrid(); } }
private void EditSelectedSubscription() { if (ctlSubscriptionGrid.SelectedCells.Count > 0) { Subscription subscription = (Subscription)ctlSubscriptionGrid.SelectedCells[0].OwningRow.DataBoundItem; SubscriptionForm form = new SubscriptionForm(subscription); if (form.ShowDialog(this) == DialogResult.OK) { subscription.NameService = form.NameService; subscription.Description = form.Description; logic.UpdateSubscription(subscription); } } UpdateUsersGrid(); UpdateSubscriptionsGrid(); }