/// <summary> /// Renews an item for a patron as a staff member. /// </summary> /// <param name="patronBarcode">The patron's barcode.</param> /// <param name="itemId">The ID of the item to renew, NOT barcode.</param> /// <param name="options">Item renew options</param> /// <returns>An item containing the result of the item renewal.</returns> /// <seealso cref="ItemsOutActionResult"/> public PapiResponse <ItemsOutActionResult> ItemRenewOverride(string patronBarcode, int itemId, ItemRenewOptions options = null) { if (options == null) { options = new ItemRenewOptions(); } var url = $"/PAPIService/REST/public/v1/1033/100/1/patron/{patronBarcode}/itemsout/{itemId}"; var xml = ItemRenewHelper.BuildXml(options); return(OverrideExecute <ItemsOutActionResult>(HttpMethod.Put, url, body: xml)); }
/// <summary> /// Build the XML for PAPI item renewal /// </summary> /// <param name="options"></param> /// <returns></returns> public static string BuildXml(ItemRenewOptions options) { var doc = new XDocument( new XElement("ItemsOutActionData", new XElement("Action", "renew"), new XElement("LogonBranchID", options.BranchId), new XElement("LogonUserID", options.UserId), new XElement("LogonWorkstationID", options.WorkstationId), new XElement("RenewData", new XElement("IgnoreOverrideErrors", options.IgnoreOverrideErrors)) ) ); return(doc.ToString()); }
/// <summary> /// Renews all of a patron's items as a staff member. /// </summary> /// <param name="barcode">The patron's barcode.</param> /// <param name="options">Item renew options</param> /// <returns>An item containing the result of the renewal.</returns> /// <seealso cref="ItemsOutActionResult"/> public PapiResponse <ItemsOutActionResult> staff_ItemRenewAllForPatron(string barcode, ItemRenewOptions options = null) { return(ItemRenewOverride(barcode, 0, options)); }
/// <summary> /// Uses the supplied patron credentials to renew all of their items. /// </summary> /// <param name="barcode">The patron's barcode.</param> /// <param name="password">The patron's password.</param> /// <param name="options">Item renew options</param> /// <returns>An item containing the result of the renewal.</returns> /// <seealso cref="ItemsOutActionResult"/> public PapiResponse <ItemsOutActionResult> ItemRenewAllForPatron(string barcode, string password, ItemRenewOptions options = null) { return(ItemRenew(barcode, password, 0, options)); }