コード例 #1
0
        private void InsertItemTransactionEntry(RMSDataAccessLayer.Item itm)
        {
            if (TransactionData.CurrentTransactionEntry == null)
            {
                if (ApplicationMode == SalesRegion.ApplicationMode.Ticket) //typeof(TicketItem).IsInstanceOfType(itm)
                {
                    CreateTransactionEntry <TicketEntry>();
                }
                else if (ApplicationMode == SalesRegion.ApplicationMode.Pharmacy)//typeof(Medicine).IsInstanceOfType(itm)
                {
                    CreateTransactionEntry <PrescriptionEntry>();
                }
                else
                {
                    CreateTransactionEntry <TransactionEntry>();
                }
            }

            if (itm.ItemId == 0)
            {
                throw new Exception("This is a new created item, should be existing item");
            }
            TransactionData.CurrentTransactionEntry.ItemId          = itm.ItemId;
            TransactionData.CurrentTransactionEntry.Price           = itm.Price;
            TransactionData.CurrentTransactionEntry.SalesTaxPercent = itm.SalesTax;
            TransactionData.CurrentTransactionEntry.Item            = itm;
            // SaveTransaction();
        }
コード例 #2
0
 private void InsertItemTransactionEntry(RMSDataAccessLayer.Item itm)
 {
     if (this.CurrentTransactionEntry == null)
     {
         this.Item = itm;
         return;
     }
 }