Esempio n. 1
0
        public static void AddProductCheck(XElement element, decimal qty)
        {
            CassieService.OpenProductsCheck();

            if (ClassProMode.ModePro)
            {
                element = ClassProMode.Replace(new[] { element }).First();
            }

            var product = ProductType.FromXElement(element);

            product = RepositoryProduct.Products.FirstOrDefault(p => p.CustomerId == product.CustomerId);

            if (product.Balance)
            {
                if (GetBallance(product) == null)
                {
                    var button = new Button {
                        ToolTip = "ShowBallance"
                    };
                    FunctionsService.Click(button, product);
                }
                else
                {
                    AddProductCheck(product, product.Qty);
                }
            }
            else
            {
                AddProductCheck(product, qty);
            }
        }
Esempio n. 2
0
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            if (((Button)sender).Name == "Save")
            {
                string error = "";

                foreach (TextBox bs in ClassEtcFun.FindVisualChildren <TextBox>(this))
                {
                    if (!Valid(bs))
                    {
                        error += (bs.Name + " incorrect") + Environment.NewLine;
                    }
                }

                if (error.Length == 0)
                {
                    FunctionsService.Click(sender);
                }
                else
                {
                    FunctionsService.ShowMessageTimeList(error);
                }
            }
            else
            {
                FunctionsService.Click(sender);
            }
        }
Esempio n. 3
0
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            decimal money;

            if (!string.IsNullOrEmpty(tbS.Text) && decimal.TryParse(tbS.Text.Trim(), out money) &&
                FunctionsService.PayWithValidation(sender, money, MaxMoney, PayType))
            {
                FunctionsService.Click(sender);
            }
        }
Esempio n. 4
0
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            var button = sender as Button;

            if (button?.ToolTip != null && button.ToolTip.ToString() == "WNumPadMini")
            {
                string getValue = button.Name.Remove(0, 1);

                switch (getValue)
                {
                case "Sup":
                    TextBox.Text = "";
                    break;

                case "Entree":
                    var window = Tag as WPayEtc;
                    if (window != null)
                    {
                        decimal money;
                        if (!string.IsNullOrEmpty(window.tbS.Text) &&
                            decimal.TryParse(window.tbS.Text.Trim(), out money) &&
                            FunctionsService.PayWithValidation(sender, money, window.MaxMoney, window.PayType))
                        {
                            FunctionsService.Click(BEnter);
                        }
                    }
                    else
                    {
                        FunctionsService.Click(BEnter);
                    }
                    break;

                case "Point":
                    TextBox.Text += ",";
                    break;

                default:
                    if (Clr)
                    {
                        TextBox.Text = "";
                    }
                    int f;
                    if (int.TryParse(getValue, out f))
                    {
                        TextBox.Text += getValue;
                    }
                    break;
                }

                Clr = false;
            }
        }
Esempio n. 5
0
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            var barCode = codebare.Text.Trim();
            var check   = GetCheck(barCode);

            if (check != null)
            {
                FunctionsService.Click(button, check);
            }
            else
            {
                FunctionsService.ShowMessageTime(Properties.Resources.LabelNofFound);
            }

            codebare.Text = "";
        }
Esempio n. 6
0
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            var button = sender as Button;

            if (button != null)
            {
                var b = button;

                if (b.ToolTip != null)
                {
                    if (b.ToolTip.ToString() == "WNumPadComplet")
                    {
                        string getValue = b.Name.Remove(0, 1);
                        if (Clr)
                        {
                            Box.Text = "";
                        }
                        switch (getValue)
                        {
                        case "Sup": Box.Text = ""; break;

                        case "Entree": FunctionsService.Click(BEnter); break;

                        case "Point": Box.Text += ","; break;

                        default:
                            int f;
                            if (int.TryParse(getValue, out f))
                            {
                                Box.Text += getValue;
                            }
                            break;
                        }

                        Clr = false;
                    }
                }
            }
        }
Esempio n. 7
0
        public void WindowLoaded(object sender, RoutedEventArgs e)
        {
            var rec = RepositoryHistoryChangeProduct.Document.GetXElements("HistoryChangeProducts", "rec");

            var xElements = rec as XElement[] ?? rec.ToArray();
            var first     = xElements.FirstOrDefault();

            if (first != null)
            {
                SelectGroup           = first.GetXElementValue("group").ToInt();
                dataGrid1.DataContext = xElements.Where(l => l.GetXElementValue("group") == first.GetXElementValue("group"));

                var p = xElements.Count(l => l.GetXElementValue("group") == (SelectGroup + 1).ToString());
                xP.IsEnabled = p != 0;
                xN.IsEnabled = xElements.Count(l => l.GetXElementValue("group") == (SelectGroup - 1).ToString()) != 0;
            }

            foreach (var bs in ClassEtcFun.FindVisualChildren <Button>(this))
            {
                bs.Click += (o, a) => { FunctionsService.Click(o); }
            }
            ;
        }
    }
Esempio n. 8
0
 private void BokClick(object sender, RoutedEventArgs e)
 {
     DialogResult = true;
     FunctionsService.Click(sender);
 }
Esempio n. 9
0
 private void ButtonClick1(object sender, RoutedEventArgs e)
 {
     FunctionsService.Click(sender, ((WStat)Owner).B, dataGrid.SelectedItem);
 }
Esempio n. 10
0
 private void ButtonClick(object sender, RoutedEventArgs e)
 {
     FunctionsService.Click(sender, ((WStat)Owner).B);
 }
Esempio n. 11
0
 private static void ButtonClick(object sender, RoutedEventArgs e)
 {
     FunctionsService.Click(sender);
 }
Esempio n. 12
0
 private void ButtonClick1(object sender, RoutedEventArgs e)
 {
     FunctionsService.Click(sender);
     Close();
 }
Esempio n. 13
0
 private void XEnterClick(object sender, RoutedEventArgs e)
 {
     FunctionsService.Click(sender);
 }
Esempio n. 14
0
 private void AddClick(object sender, RoutedEventArgs e)
 {
     FunctionsService.Click(sender, (ProductType)DataGrid.SelectedItem);
 }
Esempio n. 15
0
 private void ButtonClick(object sender, RoutedEventArgs e)
 {
     _countTick = 0;
     FunctionsService.Click(sender);
 }