Ejemplo n.º 1
0
 private void BillMod_Click(object sender, RoutedEventArgs e)
 {
     if (BillDisplay.SelectedItem is Bill)
     {
         Bill       selectedBill = BillDisplay.SelectedItem as Bill;
         BillWindow billWindow   = new BillWindow(viewModel.BinList.ToList(), selectedBill.BinToRemoveFrom,
                                                  selectedBill.Name, selectedBill.DueDate, selectedBill.Description, selectedBill.Amount);
         if (billWindow.ShowDialog() == true)
         {
             viewModel.ModBill(selectedBill, billWindow.BillName, billWindow.SelectedDate.Value, billWindow.BillDescription,
                               billWindow.BillAmount);
         }
     }
 }
Ejemplo n.º 2
0
        private void BillAdd_Click(object sender, RoutedEventArgs e)
        {
            if (viewModel.BinList.Count <= 0)
            {
                return;
            }
            BillWindow billWindow = new BillWindow(viewModel.BinList.ToList(), null);

            if (billWindow.ShowDialog() == true)
            {
                viewModel.AddBill(billWindow.BillName, billWindow.SelectedDate.Value, billWindow.BillDescription,
                                  billWindow.BillAmount, billWindow.BinToRemoveFrom);
            }
        }