public ApartmentOwnershipLegalizationAddChengeForm(ApartmentOwnershipLegalization aol)
     : this()
 {
     this.m_ApartmentOwnershipLegalization = aol;
     this.datePeriod.DateBegin = this.m_ApartmentOwnershipLegalization.FromDate;
     this.datePeriod.DateEnd = this.m_ApartmentOwnershipLegalization.ToDate;
     if (this.m_ApartmentOwnershipLegalization.IsNew)
     {
         this.set_Text("Добавление");
         this.btnOK.set_Text("Добавить");
     }
     else
     {
         this.set_Text("Изменение");
         this.btnOK.set_Text("Изменить");
     }
 }
 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));
     }
 }