/// <summary> /// This function is responsible for populating the book history grid. /// </summary> /// <param name="bookID">Book ID</param> private void displayBookCheckOutHistory(int bookID) { BusinessLogicDBOperations dbOperations = new BusinessLogicDBOperations(); List <Borrower> borrowers = dbOperations.RetrieveBookCheckOutHistory(bookID); HistoryList.DataSource = borrowers; HistoryList.DataBind(); }
private void DisplayBookCheckOutHistory(int bookId) { var dbOperations = new GenericDatContext(); var borrowers = dbOperations.GetCheckOutSummeryByBook(bookId); HistoryList.DataSource = borrowers; HistoryList.DataBind(); }
private void DisplayBookInfo(int BookID) { try { BusinessLogicDBOperations dbOperations = new BusinessLogicDBOperations(); Book book = dbOperations.RetrieveBooksList(BookID).Where(x => x.BookID == BookID).FirstOrDefault(); if (book != null) { lblBookTitle.Text = book.Title; lblCheckInStatus.Text = book.CheckOutStatusDescription; lblCoverPrice.Text = book.CoverPrice.ToString("N0"); lblISBN.Text = book.ISBN; lblName.Text = ""; lblPublishYear.Text = book.PublishYear; //Get book borrower history BusinessLogicDBOperations dbBorrowers = new BusinessLogicDBOperations(); List <Borrower> borrowers = dbOperations.RetrieveBookCheckOutHistory(BookID); if (book.CheckOutStatusID == 1) { Borrower borrower = borrowers.LastOrDefault(); if (borrower != null) { lblName.Text = borrower.Name; } } else { lblName.Text = "Book is checked in."; } HistoryList.DataSource = borrowers; HistoryList.DataBind(); } else { Utilities.Utilities.setPageMessage("Book is either already checked in or was not found.", Utilities.Utilities.severity.error, Page.Master); return; } } catch (Exception ex) { BusinessLogicDBOperations dbOperations = new BusinessLogicDBOperations(); dbOperations.ErrorLog(ex.Message, Request.Url.AbsoluteUri); } }
/// <summary> /// This function is responsible for populating the book history grid. /// </summary> /// <param name="bookId">Book ID</param> private void DisplayBookCheckOutHistory(int bookId) { try { BusinessLogicDBOperations dbOperations = new BusinessLogicDBOperations(); List <Borrower> borrowers = dbOperations.RetrieveBookCheckOutHistory(bookId); HistoryList.DataSource = borrowers; HistoryList.DataBind(); } catch (Exception ex) { Utilities.Instance.SetPageMessage(ex.Message, Utilities.Severity.Error, Page.Master); } }
protected void Page_Load(object sender, EventArgs e) { sCategoryGUID = (string)Session["ZJSP_ZTFL_GUID"]; //*CC* DataTable CategoryInfo = new DAL.CategoryDAL().GetCategorySimpleInfo(sCategoryGUID); if (CategoryInfo.Rows.Count == 0) { return; } string sCategoryPath = CategoryInfo.Rows[0]["CategoryPath"].ToString(); int iYIndex = int.Parse(CategoryInfo.Rows[0]["YIndex"].ToString()) + 1; DataTable ZTList = new DAL.CategoryDAL().GetZTFromCategory(sCategoryPath, iYIndex, 10, "asc"); HistoryList.DataSource = ZTList; HistoryList.DataBind(); //HistoryMore.NavigateUrl = "SpecialHistory.aspx?ID=" + sCategoryGUID; }
private void BindBookBorrowHistory() { HistoryList.DataSource = BorrowerHistory; HistoryList.DataBind(); }