Пример #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="transactionInformation"></param>
 /// <returns></returns>
 private static ListViewItem ParseTransaction(WarehouseOrder transactionInformation)
 {
     return(new ListViewItem(LibrettoCommon.FormatDate(transactionInformation.Timestamp))
     {
         Name = LibrettoCommon.FormatGuid(transactionInformation.Identifier),
         SubItems =
         {
             LibrettoCommon.FormatGuid(transactionInformation.Identifier),
             transactionInformation.Title,
             Convert.ToString(transactionInformation.Quantity),
             LibrettoCommon.FormatCurrency(transactionInformation.Total)
         }
     });
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="purchaseInformation"></param>
        /// <param name="fromQueue"></param>
        private void OnInsertAux(Invoice purchaseInformation, bool fromQueue)
        {
            var purchaseIdentifier = purchaseInformation.Identifier.ToString("B").ToUpper();
            var purchaseTimestamp  = LibrettoCommon.FormatDate(purchaseInformation.Timestamp);

            if (fromQueue)
            {
                _invoices.Insert(purchaseInformation);
                _invoices.Serialize(_serializer, LibrettoCommon.InvoicesFilename);
                notifyIcon.ShowBalloonTip(5000, $"Invoice Arrived [{purchaseTimestamp}]", $"Identifier: {purchaseIdentifier}", ToolTipIcon.Info);
            }

            listView.Items.Add(new ListViewItem(purchaseTimestamp)
            {
                SubItems =
                {
                    purchaseIdentifier
                }
            });
        }