// GET: Admin/Invoices
        public ActionResult Index()
        {
            var invoices = _repo.GetInvoices();
            var vm       = new List <InvoiceTableViewModel>();

            foreach (var invoice in invoices)
            {
                vm.Add(new InvoiceTableViewModel(invoice));
            }
            return(View(vm));
        }
Exemple #2
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                //TODO: retrieve invoices due from data layer
                List <Invoice> invoices = new List <Invoice>();
                invoices = InvoicesRepository.GetInvoices();
                //TODO: show a message box when no invoiced are due and close the application
                InvoicesListView.ItemsSource = invoices;

                //InvoicesListView.ItemsSource = InvoicesRepository.GetInvoices();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.GetType().ToString());
                Close();
            }
        }