예제 #1
0
        public ListsViewModel()
        {
            BorrowBookCommand   = new DelegateCommand(BorrowBook);
            BookAddCommand      = new DelegateCommand(BookAdd);
            CustomerAddCommand  = new DelegateCommand(CustomerAdd);
            CustomerSaveCommand = new DelegateCommand(CustomerSave);
            BookSaveCommand     = new DelegateCommand(BookSave);

            BookViewCommand   = new DelegateCommand(BookView);
            BookDeleteCommand = new DelegateCommand(BookDelete);
            BookEditCommand   = new DelegateCommand(BookEdit);

            CustomerViewCommand   = new DelegateCommand(CustomerView);
            CustomerDeleteCommand = new DelegateCommand(CustomerDelete);
            CustomerEditCommand   = new DelegateCommand(CustomerEdit);

            ViewCommand           = new DelegateCommand(ViewDetails);
            ReturnBookCommand     = new DelegateCommand(ReturnBook);
            EditReturnDateCommand = new DelegateCommand(EditReturnDate);


            b = GetBooks()[1];
            int _id = CustomerCRUD.getMaxId() + 1;

            customer = new Customer(_id, "name", 0);

            int _id2 = BookCRUD.getMaxId() + 1;

            book = new Book(_id2, "title", "author", "type", 0, DateTime.Today, 0);
        }
예제 #2
0
 public ObservableCollection <Customer> GetCustomers()
 {
     customers = new ObservableCollection <Customer>();
     for (int i = 1; i <= CustomerCRUD.getMaxId(); i++)
     {
         Customer c = new Customer(i);
         if (c.Name != null)
         {
             customers.Add(c);
         }
     }
     return(customers);
 }