Ejemplo n.º 1
0
 private void CheckQuantity()
 {
     if (ticketlineBindingSource.Count <= 0)
     {
         MessageBox.Show(@"Enter an item first.");
         BarcodeInputTextBox.Select();
         return;
     }
     if (!string.IsNullOrEmpty(MultiplierTextBox.Text))
     {
         var    newString = MultiplierTextBox.Text.Contains("x") ? MultiplierTextBox.Text.Replace("x", "") : MultiplierTextBox.Text;
         double quantityCount;
         if (double.TryParse(newString, out quantityCount))
         {
             var line = ticketlineBindingSource.Current as TicketLine;
             if (line != null)
             {
                 line.Quantity = quantityCount;
                 ticketlineBindingSource.ResetCurrentItem();
                 MultiplierTextBox.Clear();
                 BarcodeInputTextBox.Select();
             }
         }
     }
     CheckTotal();
 }
Ejemplo n.º 2
0
 private void ItemTenderGrid_CellMouseLeave(object sender, DataGridViewCellEventArgs e)
 {
     if (string.IsNullOrEmpty(BarcodeInputTextBox.Text))
     {
         BarcodeInputTextBox.Select();
     }
 }
Ejemplo n.º 3
0
 private void InitAll()
 {
     //--set icon
     Icon = Resources.shopping_cart;
     //--align numeric textboxes
     TotalAmountTextBox.TextAlign    = HorizontalAlignment.Right;
     TotalAmountTextBox.RightToLeft  = RightToLeft.No;
     CashAmountTextBox.TextAlign     = HorizontalAlignment.Right;
     CashAmountTextBox.RightToLeft   = RightToLeft.No;
     ChangeAmountTextBox.TextAlign   = HorizontalAlignment.Right;
     ChangeAmountTextBox.RightToLeft = RightToLeft.No;
     //--set default input
     TotalAmountTextBox.Text  = (0).ToString("#,##0.00");
     CashAmountTextBox.Text   = (0).ToString("#,##0.00");
     ChangeAmountTextBox.Text = (0).ToString("#,##0.00");
     BarcodeInputTextBox.Clear();
     //--set appearance
     TotalAmountTextBox.ForeColor  = Color.FromArgb(0, 174, 219);
     CashAmountTextBox.ForeColor   = Color.FromArgb(0, 174, 219);
     ChangeAmountTextBox.ForeColor = Color.FromArgb(0, 174, 219);
     //--change button text colors
     ItemButton.Style   = MetroColorStyle.Blue;
     StocksButton.Style = MetroColorStyle.Blue;
     MenuButton.Style   = MetroColorStyle.Blue;
     VoidButton.Style   = MetroColorStyle.Blue;
     PayButton.Style    = MetroColorStyle.Blue;
     //--set shortcuts
 }
Ejemplo n.º 4
0
        private void InputBarcodeItem()
        {
            var barcode = BarcodeInputTextBox.Text.Trim();
            var product = SearchBarcode(barcode);

            if (product != null)
            {
                AddProduct(product, 1);
                BarcodeInputTextBox.Clear();
            }
        }
Ejemplo n.º 5
0
        private void SalesForm_Load(object sender, EventArgs e)
        {
            printFont   = new Font("Arial", 11f);
            gray        = Brushes.Gray;
            receiptFont = new Font("Arial", 7.5f);
            creditFont  = new Font("Arial", 7.5f);
            context     = new PosContext();

            InitAll();
            NewTicket();
            InitItemTenderGrid();
            //--set focus to barcode
            Activate();
            BarcodeInputTextBox.Select();
        }
Ejemplo n.º 6
0
 private void CreateNewTransaction()
 {
     if (ticketlineBindingSource != null && ticketlineBindingSource.Count > 0)
     {
         NewTicket();
     }
     TotalCash = 0;
     //-- clear amount boxes
     TotalAmountTextBox.Text  = DisplayAmountAsText(0);
     CashAmountTextBox.Text   = DisplayAmountAsText(0);
     ChangeAmountTextBox.Text = DisplayAmountAsText(0);
     //-- clear customer
     CustomerTextBox.Clear();
     CustomerCodeTextBox.Clear();
     //-- clear barcode
     BarcodeInputTextBox.Clear();
 }
Ejemplo n.º 7
0
        private void DetectMdasItems()
        {
            if (BarcodeInputTextBox.Text.Contains("+") || BarcodeInputTextBox.Text.Contains("-"))
            {
                BarcodeInputTextBox.Clear();
            }

            if (BarcodeInputTextBox.Text.Contains("*"))
            {
                BarcodeInputTextBox.Clear();

                if (ticketlineBindingSource.Count > 0)
                {
                    MultiplierTextBox.Focus();
                    MultiplierTextBox.Text = @"x";
                    MultiplierTextBox.Select(MultiplierTextBox.Text.Length, 0);
                }
            }
        }
Ejemplo n.º 8
0
 private void ClearButton_Click(object sender, EventArgs e)
 {
     BarcodeInputTextBox.Clear();
     BarcodeInputTextBox.Select();
 }