private void tsbChange_Click(object sender, System.EventArgs e) { this.m_ApartmentType = (this.bsApartmentType.get_Current() == null) ? ApartmentType.Null : ((ApartmentType) this.bsApartmentType.get_Current()); if (this.m_ApartmentType != ApartmentType.Null) { ApartmentTypeAddChangeForm form = new ApartmentTypeAddChangeForm(this.m_ApartmentType); form.set_Text("Изменение"); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.bsApartmentType.set_Sort(this.bsApartmentType.get_Sort()); this.update = true; } } }
private void tsbAdd_Click(object sender, System.EventArgs e) { ApartmentType apartmentType = new ApartmentType { ApartmentId = this.m_ApartmentType.ApartmentId, FasetId = this.m_ApartmentType.FasetId }; ApartmentTypeAddChangeForm form = new ApartmentTypeAddChangeForm(apartmentType); form.set_Text("Добавление"); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.bsApartmentType.Add(apartmentType); this.bsApartmentType.set_Sort(this.bsApartmentType.get_Sort()); this.update = true; } }