private void tbsAdd_Click(object sender, System.EventArgs e)
 {
     ServiceSplitPercent splittingCalcOrganization = new ServiceSplitPercent {
         ServiceSplitDocumentId = this._mServiceSplitDocument.Id
     };
     ServiceSplitPercentAddChangeForm form = new ServiceSplitPercentAddChangeForm(splittingCalcOrganization);
     form.set_Text("Добавление записи");
     if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.Yes)
     {
         this.bsServiceSplitPercents.Add(splittingCalcOrganization);
         this.bsServiceSplitPercents.set_Position(this.bsServiceSplitPercents.IndexOf(splittingCalcOrganization));
     }
 }
 public ServiceSplitPercentAddChangeForm(ServiceSplitPercent splittingCalcOrganization)
     : this()
 {
     this.m_splittingCalcOrganization = splittingCalcOrganization;
 }
 private void SchemeSplittingCalcsAddChangeForm_Load(object sender, System.EventArgs e)
 {
     this.set_Font(Manager.WindowFont);
     if (this._mServiceSplitDocument.IsNew)
     {
         this.tsButtons.set_Enabled(false);
     }
     ServiceSplitPercent percent = new ServiceSplitPercent {
         ServiceSplitDocumentId = this._mServiceSplitDocument.Id
     };
     this.bsServiceSplitPercents.set_DataSource(ServiceSplitPercent.GetBySchemeSplittingCalcId(percent.ServiceSplitDocumentId));
     if (!this._mServiceSplitDocument.IsNew)
     {
         this.btnOk.set_Text("Изменить");
         this.selectOrgDocument.SelectedOrgDocument = OrgDocument.FindById(this._mServiceSplitDocument.MainOrgDocumentId);
         this.selectOrganization.SelectedOrganizationOld = Organization.FindById(this._mServiceSplitDocument.OrganizationId);
         if (this._mServiceSplitDocument.ToDate != Constants.NullDate)
         {
             this.datePeriod.DateEnd = this._mServiceSplitDocument.ToDate;
         }
         this.datePeriod.DateBegin = this._mServiceSplitDocument.FromDate;
         this.tbComment.set_Text(this._mServiceSplitDocument.Comment);
     }
     else
     {
         this.btnOk.set_Text("Добавить");
     }
 }
 public ServiceSplitPercentAddChangeForm()
 {
     this.m_splittingCalcOrganization = ServiceSplitPercent.Null;
     this.InitializeComponent();
 }