public FinancesPage(WindowViewModel vm, Predio p) { InitializeComponent(); this.vm = vm; this.p = p; showColumnChart(); Transacoes = new ObservableCollection <Transacao>(Outros_Pagamentos.get_OutrosPagamentos(p, EndDate, StartDate).Union(new ObservableCollection <Transacao>(Pagamentos_Quota.get_Quotas(p.ID, EndDate, StartDate)))); PropertyChanged(this, new PropertyChangedEventArgs("Transacoes")); }
private void AddPayment(object sender, RoutedEventArgs e) { string desc = tbDesc.Text; string balanco = tbBalanco.Text; if (datePicker.SelectedDate == null) { ErrorLabel.Content = "Escolha uma data para o pagamento"; ErrorBorder.Visibility = Visibility.Visible; return; } DateTime data = (DateTime)datePicker.SelectedDate; if (ChooseSujFis.SelectedItem == null) { ErrorLabel.Content = "Escolha um sujeito fiscal para associar ao pagamento"; ErrorBorder.Visibility = Visibility.Visible; return; } Sujeito_Fiscal sf = (Sujeito_Fiscal)ChooseSujFis.SelectedItem; if (string.IsNullOrEmpty(balanco)) { ErrorLabel.Content = "O campo 'Balanco' necessita de ser preenchido com um valor numérico"; ErrorBorder.Visibility = Visibility.Visible; return; } double bal; try { bal = double.Parse(balanco); } catch (Exception exc) { ErrorLabel.Content = "O campo 'Balanco' necessita de ser preenchido com um valor numérico"; ErrorBorder.Visibility = Visibility.Visible; return; } Console.WriteLine(desc); Outros_Pagamentos op = new Outros_Pagamentos(data, -bal, p, sf, desc); if (lastPage == ApplicationPage.AddManutencaoWDate_Page) { vm.changeViewAddManutencaoWDate(p, op); } else { vm.changeViewAddManutencao(initialDT, p); } }
public AddManutencaoWithDate(WindowViewModel vm, Predio p, Outros_Pagamentos pg = null) { InitializeComponent(); this.vm = vm; this.p = p; if (pg != null) { op = pg; AddPay.Visibility = Visibility.Collapsed; SP.Visibility = Visibility.Visible; } }