private void BtnCalc_OnClick(object sender, RoutedEventArgs e) { foreach (Flat flat in flatView.SelectedItems) { var account = new Account(06,2013,DateTime.Now); foreach (Service service in serviceView.SelectedItems) { account.Add(new ProvidedService(service)); } account.Calculation(flat); flat.Add(account); } TsContext.SaveChanges(); this.Close(); }
public void Add(Account account) { if (account == null) return; account.Calculation(this); this.Accounts.Add(account); }