private void btnAdd_Click(object sender, EventArgs e) { var company = (Company)listCompanies.SelectedItem; var f = new AgreementEditor(new Agreement { Date = DateTime.Now, CompanyId = company.CompanyID, Number = "", Billing = "BF" }); f.ShowDialog(); if (f.DialogResult != DialogResult.OK) { return; } uof.Agreements.Add(f.Agreement); uof.Complete(); UpdateAgreements(company); //Agreements.Add(f.Agreement); //UpdateView(Agreements); }
private void btnEdit_Click(object sender, EventArgs e) { var company = (Company)listCompanies.SelectedItem; var agr = (Agreement)listAgreements.SelectedItem; if (agr == null) { return; } var f = new AgreementEditor(agr); f.ShowDialog(); if (f.DialogResult != DialogResult.OK) { return; } uof.Agreements.Modify(agr); uof.Complete(); UpdateAgreements(company); listBills_SelectedIndexChanged(sender, e); }