private void tsBtnEdit_Click(object sender, System.EventArgs e)
 {
     if (this.bsCounterPlaceFactors.get_Current() is ApartmentCounterPlaceFactor)
     {
         AddChangeCounterPlaceFactorForm form = new AddChangeCounterPlaceFactorForm(this.bsCounterPlaceFactors.get_Current() as ApartmentCounterPlaceFactor);
         if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
         {
             this.bsCounterPlaceFactors.RemoveCurrent();
             this.bsCounterPlaceFactors.Add(form.ApartmentCounterPlaceFactor);
             this.bsCounterPlaceFactors.set_Position(this.bsCounterPlaceFactors.IndexOf(form.ApartmentCounterPlaceFactor));
         }
     }
 }
 private void tsBtnAdd_Click(object sender, System.EventArgs e)
 {
     AddChangeCounterPlaceFactorForm form = new AddChangeCounterPlaceFactorForm(this.sfdPlaces.SelectedFasetItem, this.periodSelector.Period, this.numFactor.Value);
     if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
     {
         this.bsCounterPlaceFactors.Add(form.ApartmentCounterPlaceFactor);
         this.bsCounterPlaceFactors.set_Position(this.bsCounterPlaceFactors.IndexOf(form.ApartmentCounterPlaceFactor));
     }
 }