private void DisplayBorrowerDeails(int bookId)
        {
            try
            {
                BusinessLogicDBOperations dbOperations = new BusinessLogicDBOperations();
                Borrower borrower = dbOperations.RetrieveBookBorrowerDetails(bookId);

                if (borrower != null)
                {
                    lblName.Text          = borrower.Name;
                    lblMobile.Text        = borrower.MobileNo;
                    lblReqReturnDate.Text = borrower.ReturnDate.ToString();
                    lblReturnDate.Text    = DateTime.Now.ToString();
                    hdnField.Value        = borrower.Book.ModifiedOn.ToJson();
                    double penaltyAmount = Utilities.Instance.CalcultePenaltyAmount(DateTime.Now, borrower.ReturnDate);
                    lblPenaltyAmount.Text = String.Format("{0:#,##0.00}", penaltyAmount);
                }
                else
                {
                    btnCheckIn.Enabled = false;
                    Utilities.Instance.SetPageMessage("Book is either already checked in or was not found.", Utilities.Severity.Error, Page.Master);
                    return;
                }
            }
            catch (Exception ex)
            {
                btnCheckIn.Enabled = false;
                Utilities.Instance.SetPageMessage(ex.Message, Utilities.Severity.Error, Page.Master);
            }
        }
        private void DisplayBookDetails(int bookId)
        {
            BusinessLogicDBOperations dbOp = new BusinessLogicDBOperations();

            try
            {
                Book book = dbOp.RetrieveBookDetails(bookId);
                lblBookTitle.Text   = book.Title;
                lblISBN.Text        = book.ISBN;
                lblPrice.Text       = book.CoverPrice.ToString("0.##", CultureInfo.InvariantCulture);
                lblPublishYear.Text = book.PublishYear;
                lblStatus.Text      = book.CheckOutStatusDescription;

                if (lblStatus.Text == "Check out")
                {
                    Borrower borrower = dbOp.RetrieveBookBorrowerDetails(bookId);
                    lblCurrentBorrower.Text = borrower.Name;
                }
                else
                {
                    lblCurrentBorrower.Text = "None";
                }
            }
            catch (Exception ex)
            {
                Utilities.Instance.SetPageMessage(ex.Message, Utilities.Severity.Error, Page.Master);
                return;
            }
        }
Ejemplo n.º 3
0
        private void displayBorrowerDeails(int BookID)
        {
            BusinessLogicDBOperations dbOperations = new BusinessLogicDBOperations();
            Borrower borrower = dbOperations.RetrieveBookBorrowerDetails(BookID);

            if (borrower != null)
            {
                lblName.Text          = borrower.Name;
                lblMobile.Text        = borrower.MobileNo;
                lblReqReturnDate.Text = borrower.ReturnDate.ToShortTimeString();
                lblReturnDate.Text    = DateTime.Now.ToString();

                double penaltyAmount = calcultePenaltyAmount(DateTime.Now, borrower.ReturnDate);
                lblPenaltyAmount.Text = String.Format("{0:#,##0.00}", penaltyAmount);
            }
            else
            {
                Utilities.Utilities.setPageMessage("Book is either already checked in or was not found.", Utilities.Utilities.severity.error, Page.Master);
                return;
            }
        }