private void btnChangeAccountServiceGroup_Click(object sender, System.EventArgs e) { AccountServiceGroup currentAcoountServiceGroup = this.GetCurrentAcoountServiceGroup(); if (currentAcoountServiceGroup != AccountServiceGroup.Null) { AccountServiceGroupsAddChangeForm form = new AccountServiceGroupsAddChangeForm(currentAcoountServiceGroup); if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes) { this.bsAccountServiceGroups.set_Sort(this.bsAccountServiceGroups.get_Sort()); this.bsAccountServiceGroups.set_Position(this.bsAccountServiceGroups.IndexOf(currentAcoountServiceGroup)); } } }
private void btnAddAccountServiceGroup_Click(object sender, System.EventArgs e) { if (this.m_Account != Account.Null) { AccountServiceGroup sg = new AccountServiceGroup { AccountId = this.m_Account.Id }; AccountServiceGroupsAddChangeForm form = new AccountServiceGroupsAddChangeForm(sg); if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes) { this.bsAccountServiceGroups.Add(sg); this.bsAccountServiceGroups.set_Sort(this.bsAccountServiceGroups.get_Sort()); this.bsAccountServiceGroups.set_Position(this.bsAccountServiceGroups.IndexOf(sg)); } } }