private void tsbChange_Click(object sender, System.EventArgs e)
 {
     ApartmentOwnershipLegalization currentBS = this.GetCurrentBS();
     if (currentBS != ApartmentOwnershipLegalization.Null)
     {
         ApartmentOwnershipLegalizationAddChengeForm form = new ApartmentOwnershipLegalizationAddChengeForm(currentBS);
         if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.Yes)
         {
             this.bsApartmentOwnershipLegalization.set_Sort(this.bsApartmentOwnershipLegalization.get_Sort());
             this.bsApartmentOwnershipLegalization.set_Sort(this.bsApartmentOwnershipLegalization.get_Sort());
             this.bsApartmentOwnershipLegalization.set_Position(this.bsApartmentOwnershipLegalization.IndexOf(currentBS));
         }
     }
 }
 private void tsbAdd_Click(object sender, System.EventArgs e)
 {
     ApartmentOwnershipLegalization legalization;
     legalization = new ApartmentOwnershipLegalization {
         ApartmentOwnerId = this.m_apartmentOwner.Id,
         FromDate = System.DateTime.Now.Date,
         ToDate = legalization.FromDate.AddMonths(6)
     };
     ApartmentOwnershipLegalizationAddChengeForm form = new ApartmentOwnershipLegalizationAddChengeForm(legalization);
     if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.Yes)
     {
         this.bsApartmentOwnershipLegalization.Add(legalization);
         this.bsApartmentOwnershipLegalization.set_Sort(this.bsApartmentOwnershipLegalization.get_Sort());
         this.bsApartmentOwnershipLegalization.set_Position(this.bsApartmentOwnershipLegalization.IndexOf(legalization));
     }
 }