private void insertGroup() { AreaGroup groupSets = new AreaGroup { Name = this.areaGroup.Name }; try { groupSets.SaveChanges(); this.AddGroupOrSets(groupSets, this.areaGroup.GetAreas()); } catch (System.Exception exception) { Messages.ShowException(this, exception); return; } this.SetGroups(AreaGroup.FindAll()); }
private void btnAddGroup_Click(object sender, System.EventArgs e) { if (!this.bwLoadAddresses.get_IsBusy()) { EnterNameForm form = new EnterNameForm(); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { AreaGroup group = new AreaGroup { Name = form.EnteredName }; try { group.SaveChanges(); } catch (System.Exception exception) { Messages.ShowException(this, exception); return; } this.SetGroups(AreaGroup.FindAll()); Messages.ShowMessage("Создана группа \"" + group.Name + "\"."); } form.Dispose(); } }