예제 #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 <Book> GetBooks()
 {
     books = new ObservableCollection <Book>();
     for (int i = 1; i <= BookCRUD.getMaxId(); i++)
     {
         Book b = new Book(i);
         if (b.State != -1)
         {
             books.Add(b);
         }
     }
     return(books);
 }
예제 #3
0
        private void BookSave()
        {
            int _id = BookCRUD.getMaxId() + 1;

            BookCRUD.addBook(_id, this.Title, this.Author, this.Type, this.PenaltyCost, this.ReturnDate, this.State);
        }