private void btnAdd_Click(object sender, System.EventArgs e) { OrgDocument owid = new OrgDocument(); OrgDocumentDTO searchDTO = (OrgDocumentDTO) this.orgDocumentView.GetSearchDTO(); owid.Id = -1L; owid.Number = searchDTO.Number; owid.Organization = searchDTO.Organization; owid.Type = searchDTO.Type; owid.WhenGet = searchDTO.WhenGet; owid.FromDate = searchDTO.FromDate; owid.ToDate = searchDTO.ToDate; CollectionForm form = new CollectionForm(owid, "Добавить новый документ", new OrgDocumentView()); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.orgDocumentBindingSource.Add(form.SelectedObject); this.orgDocumentBindingSource.set_Position(this.orgDocumentBindingSource.IndexOf(form.SelectedObject)); } }
private void btnAdd_Click(object sender, System.EventArgs e) { CollectionForm form = new CollectionForm(null, "Добавить новую организацию", new OrganizationView()); if (System.Windows.Forms.DialogResult.OK == form.ShowDialog(this)) { this.bsOrganizations.Add(form.SelectedObject); this.bsOrganizations.set_Position(this.bsOrganizations.IndexOf(form.SelectedObject)); } }
private void addToolStripButton_Click(object sender, System.EventArgs e) { CollectionForm form = new CollectionForm(null, "Добавление тарифа для услуги: " + this.service, new ServiceTariffView(this.service)); form.set_Height((int) (form.get_Height() - 320)); form.IsReadOnly = this.IsReadOnly; if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.serviceTariffBindingSource.Add(form.SelectedObject); this.serviceTariffBindingSource.set_Position(this.serviceTariffBindingSource.IndexOf(form.SelectedObject)); this.changeToolStripButton.PerformClick(); } }