示例#1
0
        private void LogReceive(CheckoutMatch item, DateTime receptionTime)
        {
            var message = string.Format("[{0:dd/MM/yyyy hh:mm:ss}] Received barcode '{1}' for member #{2}, initial check out was {3:dd/MM/yyyy}.\n", receptionTime, item.InventoryId, item.MemberId, item.CheckoutDate);

            richLog.AppendText(message);
            //ensure the latest message is viewable
            richLog.ScrollToCaret();
        }
示例#2
0
        private bool ReceiveItem(CheckoutMatch item, DateTime returnTime)
        {
            int rowsAffected = 0;

            using (var cmd = DbConnection.CreateCommand())
            {
                cmd.CommandText = "update CHECKOUT_ITEM " +
                                  "set ReturnedDate = @ReturnDate " +
                                  "where CheckoutID = @CheckoutID " +
                                  "and InventoryID = @InventoryID " +
                                  "and ReturnedDate is null";

                cmd.Parameters.AddWithValue("ReturnDate", returnTime);
                cmd.Parameters.AddWithValue("CheckoutID", item.CheckoutId);
                cmd.Parameters.AddWithValue("InventoryID", item.InventoryId);

                rowsAffected = cmd.ExecuteNonQuery();
            }

            return(1 == rowsAffected);
        }