/// <summary> /// /// </summary> /// <param name="bookInformation"></param> /// <returns></returns> private static ListViewItem ParseBook(Book bookInformation) { return(new ListViewItem(LibrettoCommon.FormatGuid(bookInformation.Id)) { Tag = bookInformation, SubItems = { bookInformation.Title, LibrettoCommon.FormatCurrency(bookInformation.Price), Convert.ToString(bookInformation.Stock) } }); }
/// <summary> /// /// </summary> /// <param name="transactionInformation"></param> /// <returns></returns> private static ListViewItem ParseTransaction(Transaction transactionInformation) { return(new ListViewItem(LibrettoCommon.FormatDate(transactionInformation.Timestamp)) { Tag = transactionInformation, SubItems = { transactionInformation.BookTitle, transactionInformation.CustomerName, Convert.ToString(transactionInformation.Quantity), LibrettoCommon.FormatCurrency(transactionInformation.Total), transactionInformation.Description } }); }
/// <summary> /// /// </summary> /// <param name="orderInformation"></param> /// <returns></returns> public Response NotifyInsert(Order orderInformation) { var customerInformation = LibrettoDatabase.CustomerIntegration.Lookup(orderInformation.CustomerId); if (customerInformation == null) { return(Response.NotFound); } return(Send(customerInformation, $"Order {orderInformation.Id:B}", $@" <b>{orderInformation.Description}</b> <br/><br/>Book: {orderInformation.BookTitle} <br/>Customer: {orderInformation.CustomerName} <br/>Quantity: {orderInformation.Quantity} <br/>Total: {LibrettoCommon.FormatCurrency(orderInformation.Total)} <br/>Timestamp: {LibrettoCommon.FormatDate(orderInformation.Timestamp)}") ? Response.Success : Response.EmailFailure); }