/// <summary> /// Reserves a book if it's already loaned /// </summary> /// <param name="stock">Stock object thats connected to the book</param> public void ReserveBook(IStockWithBorrow stock) { string storedProcedure = StoredProcedures.ReserveItem.ToString(); var obj = new { StockID = stock.StockID, UsersID = stock.ReservationsUsersID, }; using (var conn = Create_Connection()) { conn.Execute(storedProcedure, obj, commandType: CommandType.StoredProcedure); } }
/// <summary> /// Just stores the specific stockid to the BorrowList table /// </summary> /// <param name="stock">Stock object thats connected to the book</param> public void BorrowBook(IStockWithBorrow stock) { string storedProcedure = StoredProcedures.BorrowItem.ToString(); var obj = new { StockID = stock.StockID, UsersID = stock.UsersID, BorrowDate = stock.BorrowDate, DueDate = stock.DueDate }; using (var conn = Create_Connection()) { conn.Execute(storedProcedure, obj, commandType: CommandType.StoredProcedure); } }
/// <summary> /// Just stores the specific stockid to the BorrowList table /// </summary> /// <param name="stock">Stock object thats connected to the book</param> public void CheckInBook(IStockWithBorrow stock) { string storedProcedure = StoredProcedures.CheckInItem.ToString(); var obj = new { BorrowListID = stock.BorrowListID, StockID = stock.StockID, UsersID = stock.UsersID, BorrowDate = stock.BorrowDate, DueDate = stock.DueDate, ReturnDate = DateTime.Now }; using (var conn = Create_Connection()) { conn.Execute(storedProcedure, obj, commandType: CommandType.StoredProcedure); } }
public void CheckInBookProcess(IStockWithBorrow stock) { _repo.CheckInBook(stock); }
public void ReserveBookProcess(IStockWithBorrow stock) { _repo.ReserveBook(stock); }
public void BorrowBookProcess(IStockWithBorrow stock) { _repo.BorrowBook(stock); }
public void CheckInBook(IStockWithBorrow stock) { return; }
public void ReserveBook(IStockWithBorrow stock) { return; }
public void BorrowBook(IStockWithBorrow stock) { return; }