Example #1
0
        public void SaveTemp(string CustomerName, bool modifyPurchases = false)
        {
            dbConnect dbCon     = new dbConnect();
            Int32     receiptid = this.ORNumber;

            if (dbCon.CreateTempReceipt(ref receiptid, CustomerName, this.TotalAmountDue, this.CashTendered, this.SeniorDiscount, this.ItemDiscount, this.Accountid) == false)
            {
                return;
            }
            if (this.ORNumber != receiptid || this.ORNumber == receiptid && modifyPurchases)
            {
                this.ORNumber = receiptid;

                dbCon.RemoveFromTempHistory(this._ORNumber);
                foreach (KeyValuePair <string, clsPurchasedItem> purchaseditem in _lstPurchasedItems)
                {
                    if (purchaseditem.Value.Qty > 0)
                    {
                        purchaseditem.Value.ORNumber = this.ORNumber;
                        dbCon.AddTempTransaction(purchaseditem.Value);
                    }
                }
            }
            dbCon.Close();
        }