Exemplo n.º 1
0
        /// <summary>
        /// This method handles the on screen keyboard for touch screen users
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DisplayOnScreenNumPad(object sender, TouchEventArgs e)
        {
            GUI.OnScreenKeyboard.OnScreenNumPad numberPad = new GUI.OnScreenKeyboard.OnScreenNumPad(CashAmountText.Text);
            bool?dialogResult = numberPad.ShowDialog();

            if (dialogResult != null && (bool)dialogResult)
            {
                CashAmountText.Text = numberPad.GetResult();
            }
        }
 /// <summary>
 /// Change the quantity of the item selected by entering an amount via touch controls.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ChangeQuantity_TouchUp(object sender, TouchEventArgs e)
 {
     if (Transaction.SelectedItem != null)
     {
         GUI.OnScreenKeyboard.OnScreenNumPad dialog = new GUI.OnScreenKeyboard.OnScreenNumPad("");
         bool?result = dialog.ShowDialog();
         if (result != null && (bool)result && !dialog.GetResult().Equals(""))
         {
             ItemDTO item     = ((DTOs.SalesItemDTO)Transaction.SelectedItem).Item;
             int     quantity = ((DTOs.SalesItemDTO)Transaction.SelectedItem).Quantity;
             cartController.ChangeQuantity(int.Parse(dialog.GetResult()), item);
             UpdateTransactionView();
             UpdateTotal();
         }
     }
     else
     {
         MessageBox.Show("Select an Item from the transaction to change the quantity");
     }
 }