Exemplo n.º 1
0
        private void TextBox_KeyUp(object sender, KeyEventArgs e)
        {
            string bc = ((TextBox)sender).Text.Trim().TrimEnd().TrimStart();

            if ((e.Key == Key.Return) && (bc != ""))
            {
                Class.ClassSync.ClassCloseTicketTmp.PayProducts p = check.PayProducts.ToList().Find(l => l.Barcode == bc);

                if (p != null)
                {
                    listDetails.SelectedItem = p;

                    if (p.QTY == 1)
                    {
                        recalc(1, p);
                    }
                    else
                    {
                        W_How h = new W_How(p.QTY, ClassProducts.listProducts.Find(l => l.CustumerId == p.ProductId).balance);
                        h.Owner = this;

                        h.ShowDialog();
                    }
                }

                ((TextBox)sender).Text = "";
            }
        }
Exemplo n.º 2
0
        private void testProduct(Class.ClassSync.ClassCloseTicketTmp.PayProducts p, bool minus)
        {
            ClassProducts.product pr = ClassProducts.listProducts.Find(l => l.CustumerId == p.ProductId);

            if (pr != null)
            {
                W_How h = new W_How(p.QTY, pr.balance);
                h.Owner = this;
                h.ShowDialog();
            }
            else
            {
                new ClassFunctuon().showMessageSB("Такой продукт удален");
                W_How h = new W_How(p.QTY * (minus ? -1 : 1), p.QTY - (int)p.QTY == 0 ? false : true);
                h.Owner = this;
                h.ShowDialog();
            }
        }