Example #1
0
        /// <summary>
        /// Handles the form closing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void fiDiscountAmnt_FormClosing(object sender, FormClosingEventArgs e)
        {
            string sReturned = fiDiscountAmnt.sGetDataToReturn();

            fiDiscountAmnt.Dispose();

            if (sReturned == "CANCELLED")
            {
                sPaymentType = "NULL";
                this.Close();
            }
            else
            {
                string[] sCommand = sReturned.Split(',');
                sPaymentType = sCommand[0];
                try
                {
                    if (sPaymentType == "ADISCOUNT" || sPaymentType == "SDISCOUNT")
                    {
                        fAmountInput = TillEngine.TillEngine.FixFloatError(TillEngine.TillEngine.fFormattedMoneyString(sCommand[1]));
                    }
                    else
                    {
                        fAmountInput = (float)Convert.ToDecimal(sCommand[1]);
                    }
                }
                catch
                {
                    sPaymentType = "NULL";
                }
                this.Close();
            }
        }
Example #2
0
        /// <summary>
        /// The cash paid out form closing handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void fiCashPaidOut_FormClosing(object sender, FormClosingEventArgs e)
        {
            bOtherFormOpen = false;
            string sCode = fiCashPaidOut.sGetDataToReturn();

            if (sCode != "CANCELLED")
            {
                tEngine.OpenTillDrawer(false);
                tEngine.PayCashOut(sCode);
                this.Close();
            }
        }
Example #3
0
        void fiGetAmount_FormClosing(object sender, FormClosingEventArgs e)
        {
            string sToReturn = fiGetAmount.sGetDataToReturn();

            if (sToReturn != "CANCELLED")
            {
                fAmountToReceive    = TillEngine.TillEngine.fFormattedMoneyString(sToReturn);
                fAmountToReceive    = TillEngine.TillEngine.FixFloatError(fAmountToReceive);
                fpiGetPaymentMethod = new frmPaymentInput(pLocation, new Size(sSize.Width, sSize.Height), tEngine.GetCreditCards(), fAmountToReceive, false, false, false);
                fpiGetPaymentMethod.Show();
                fpiGetPaymentMethod.GetAmountFromUser = false;
                fpiGetPaymentMethod.FormClosing      += new FormClosingEventHandler(fpiGetPaymentMethod_FormClosing);
            }
        }
Example #4
0
        /// <summary>
        /// Changes the barcode of the selected key once the input form has closed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void fiGetNewCode_FormClosing(object sender, FormClosingEventArgs e)
        {
            string sNewBarcode = fiGetNewCode.sGetDataToReturn();

            if (sNewBarcode != "CANCELLED")
            {
                string[] sProductData = tEngine.GetItemDetailsForLookup(sNewBarcode);
                if (sProductData != null)
                {
                    tEngine.EditPresetKeys(sCurrentKeyBeingEdited, sNewBarcode);
                    lbDescription.Items[lbDescription.SelectedIndex] = sProductData[0];
                    lbKeyCode.Items[lbKeyCode.SelectedIndex]         = sNewBarcode;
                }
            }
        }