private static List <BorrowModel> ConvertBorrowTableToBorrowList(MediaDataSet.TabBorrowDataTable borrowTable)
        {
            List <BorrowModel> borrowList = new List <BorrowModel>();


            foreach (MediaDataSet.TabBorrowRow row in borrowTable.Rows)
            {
                BorrowModel model = BorrowModel.Parse(row);
                borrowList.Add(model);
            }
            return(borrowList);
        }
Beispiel #2
0
        public List <BorrowModel> ListBorrowedItems()
        {
            List <BorrowModel> borrowList = new List <BorrowModel>();

            borrowTable = mediaDAO.ListBorrow();

            foreach (MediaDS.TabBorrowRow row in borrowTable.Rows)
            {
                BorrowModel borrowItem = BorrowModel.Parse(row);
                borrowList.Add(borrowItem);
            }
            return(borrowList);
        }
Beispiel #3
0
        public static BorrowModel Parse(MediaDataSet.TabBorrowRow row)
        {
            BorrowModel model = new BorrowModel();

            model.BorrowID           = row.BID;
            model.UserID             = row.UID;
            model.MediaID            = row.MediaID;
            model.BorrowDate         = row.BorrowDate;
            model.ExpectedReturnDate = row.ReturnDate;
            model.ActualReturnDate   = row.ActualReturnDate;
            model.LateFee            = row.LateFee;

            return(model);
        }
Beispiel #4
0
        public static BorrowModel Parse(MediaDS.TabBorrowRow borrowRow)
        {
            if (borrowRow == null)
            {
                return(null);
            }

            BorrowModel borrow = new BorrowModel();

            borrow.bid              = borrowRow.BID;
            borrow.uid              = borrowRow.UID;
            borrow.mediaId          = borrowRow.MediaID;
            borrow.borrowDate       = borrowRow.BorrowDate.ToString("yyyyMMdd");
            borrow.returnDate       = borrowRow.ReturnDate.ToString("yyyyMMdd");
            borrow.actualReturnDate = borrowRow.ActualReturnDate.ToString("yyyyMMdd");
            borrow.lateFee          = borrowRow.LateFee;

            return(borrow);
        }