Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            pb.Visibility = Visibility.Visible;

            bok.IsEnabled = false;

            bcancel.IsCancel = false;

            _ProGrid.IsEnabled = false;

            if (_ProGrid.SelectedItem != null)
            {
                worker.DoWork += new System.ComponentModel.DoWorkEventHandler(worker_DoWork_devis);

                worker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(worker_RunWorkerCompleted_devis);

                worker.RunWorkerAsync(_ProGrid.SelectedItem);
            }
            else
            {
                var mes = new messageDlgTime();

                mes.message.Text = "select pro";

                mes.Show();
            }
        }
Exemplo n.º 2
0
        private void modeStandart(KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                string item = text.Text.TrimEnd().TrimStart().ToUpper();

                long digital;

                bool f = long.TryParse(item, out digital);

                text.Text = "";
                if (f)
                {
                    XElement elm = find(item);

                    if (elm == null)
                    {
                        var w = new B.messageDlgTime();

                        w.message.Text = "not found";



                        w.Show();

                        _ProductsGrid.Items.Refresh();
                    }
                    else
                    {
                        int indx = shelfProducts.FindIndex(l => l == elm);

                        string qtys = qty_label.Text.Replace(" box ", "").Replace(" pièces ", "").Replace('_', ' ').Replace('.', ',').Trim();

                        qty_label.Text = "__";

                        decimal qty_ = 0.0m;

                        decimal.TryParse(qtys == "0,0" || qtys == string.Empty ? "1,00" : qtys, out qty_);

                        if (indx == -1)
                        {
                            shelfProducts.Insert(0, elm);

                            ClassProducts.updQTYProduct(qty_, elm, tbcb.IsChecked ?? false, typefind);
                        }
                        else
                        {
                            ClassProducts.updQTYProduct(qty_, elm, tbcb.IsChecked ?? false, typefind);

                            shelfProducts.Remove(elm);

                            shelfProducts.Insert(0, elm);
                        }


                        _ProductsGrid.SelectedItem = elm;



                        _ProductsGrid.Items.Refresh();


                        _ProductsGrid.ScrollIntoView(_ProductsGrid.SelectedItem);

                        ClassF.wm_sound(@"Data\Beep.wav");

                        //   tbcb.IsChecked = true;

                        calcTotal();
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void modeFind(KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                elm.Clear();

                string item = text.Text.TrimEnd().TrimStart().ToUpper();

                long digital;

                bool f = long.TryParse(item, out digital);

                if (f)
                {
                    IEnumerable <XElement> elms = x.Where(l => l.Element("CodeBare").Value.Contains(item));


                    elm.AddRange(elms);
                }

                else
                {
                    elm.AddRange(findAll(item, x));
                }

                if (elm.Count() == 0)
                {
                    var ek = find(item);
                    if (ek != null)
                    {
                        elm.Add(ek);
                    }
                }

                if (elm.Count() == 0)
                {
                    var w = new B.messageDlgTime();

                    w.message.Text = "not found";



                    w.Show();
                }


                _ProductsGrid.SelectedItem = elm.FirstOrDefault();


                //  _ProductsGrid.DataContext = shelfProducts;

                _ProductsGrid.DataContext = elm;



                _ProductsGrid.Items.Refresh();

                //    tbcb.IsChecked = true;

                text.Text = "";
            }
        }