public static void InsertItem(CustomerModel customer, FullBookModel book, int amount)
 {
     using (IDbConnection connection = new SqlConnection(Tools.GetConnectionStringValue()))
     {
         connection.Execute(SPStrings.Carts_Add, new { CustomerId = customer.Id, BookISBN = book.ISBN, Amount = amount });
     }
 }
        public void GetOrderInfo(FullBookModel book, int amount)
        {
            _book       = book;
            _amount     = amount;
            _totalPrice = _book.Price * _amount;

            textBoxISBN.Text       = _book.ISBN;
            textBoxTitle.Text      = _book.Title;
            textBoxPirce.Text      = _book.Price.ToString();
            textBoxAmount.Text     = _amount.ToString();
            textBoxTotalPrice.Text = _totalPrice.ToString();
        }
예제 #3
0
 public void GetValues(FullBookModel book)
 {
     _isbn            = book.ISBN;
     _title           = book.Title;
     _author          = book.Author;
     _publisher       = book.Publisher;
     _publicationDate = book.Publication_Date;
     _genre           = book.Genre;
     _price           = book.Price;
     _quantity        = book.Quantity;
     _introduction    = book.Introduction;
     _is_on_sale      = book.Is_On_Sale;
 }
 public void GetInfo(FullBookModel book, bool add_or_update)
 {
     if (book != null)
     {
         _book        = book;
         _addOrUpdate = add_or_update;
     }
     else
     {
         MessageBox.Show("错误:找不到该图书");
         Close();
     }
 }
예제 #5
0
 public void ShowBookDetail(FullBookModel book)
 {
     textBoxISBN.Text      = book.ISBN;
     textBoxTitle.Text     = book.Title;
     textBoxAuthor.Text    = book.Author;
     textBoxPublisher.Text = book.Publisher;
     if (book.Publication_Date != null)
     {
         textBoxPublicationDate.Text = ((DateTime)book.Publication_Date).ToString("yyyy-MM-dd");
     }
     textBoxGenre.Text        = book.Genre.ToString();
     textBoxRate.Text         = book.Book_Rate.ToString();
     textBoxPrice.Text        = book.Price.ToString();
     textBoxIntroduction.Text = book.Introduction;
 }
예제 #6
0
 public void ShowDetail(string order_id, FullBookModel book, bool is_reviewed)
 {
     _orderId    = order_id;
     _book       = book;
     _isReviewed = is_reviewed;
     if (_isReviewed)
     {
         ReviewOfCustomerModel review = ReviewOfCustomerDataAccess.GetReviewByISBN(CustomerInfo.customer.Id, _book.ISBN);
         _reviewRate = review.Review_Rate;
         SetReviewRate();
         textBoxReviewContent.Text = review.Review_Content;
     }
     textBoxISBN.Text  = _book.ISBN;
     textBoxTitle.Text = _book.Title;
 }