public BenefitNormsForSquareAddChangeForm(BenefitNormsForSquare bnfe)
     : this()
 {
     this.m_BenefitNormsForSquare = bnfe;
     this.bsBenefitNormsForSquare.set_DataSource(this.m_BenefitNormsForSquare);
     this.m_BenefitNormsForSquare.BeginEdit();
     if (this.m_BenefitNormsForSquare.IsNew)
     {
         this.set_Text("Добавление записи");
         this.btnYes.set_Text("Добавить");
     }
     else
     {
         this.set_Text("Изменение записи");
         this.btnYes.set_Text("Изменить");
         if (this.m_BenefitNormsForSquare.BenefitId == 0L)
         {
             this.selectBenefit1.SelectedBenefit = Benefit.Null;
         }
         else
         {
             this.selectBenefit1.SelectedBenefit = this.m_BenefitNormsForSquare.GetBenefit();
         }
     }
 }
 private void tsbAdd_Click(object sender, System.EventArgs e)
 {
     BenefitNormsForSquare bnfe = new BenefitNormsForSquare();
     BenefitNormsForSquareAddChangeForm form = new BenefitNormsForSquareAddChangeForm(bnfe);
     if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
     {
         this.bsBenefitNormsForSquare.Add(bnfe);
         this.bsBenefitNormsForSquare.set_Sort(this.bsBenefitNormsForSquare.get_Sort());
         this.bsBenefitNormsForSquare.set_Sort(this.bsBenefitNormsForSquare.get_Sort());
         this.bsBenefitNormsForSquare.set_Position(this.bsBenefitNormsForSquare.IndexOf(bnfe));
     }
 }