Esempio n. 1
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. 2
0
 private void UserControlLoaded(object sender, RoutedEventArgs e)
 {
     foreach (var bs in ClassEtcFun.FindVisualChildren <Button>(this))
     {
         bs.Click += ButtonClick;
     }
 }
Esempio n. 3
0
        private void DispatcherTimerTick(object sender, EventArgs e)
        {
            var dt = DateTime.Now;

            _countTick++;

            ldt.Content = $"{dt} ({Sec - _countTick}) ";

            if (!Config.FromLoadSyncAll)
            {
                if (_countTick == Sec)
                {
                    _countTick = 0;

                    foreach (var bs in ClassEtcFun.FindVisualChildren <Button>(this).Where(bs => (string)bs.ToolTip == "UpdateDB"))
                    {
                        if (_bUpdText == string.Empty)
                        {
                            _bUpdText = bs.Content.ToString();
                        }
                        bs.Content = $"{_bUpdText} ({RepositoryProduct.GetAbCountFromDb()})";
                    }

                    ldtc.Content = "BD a été MàJ " + dt.ToLongTimeString();
                }
            }
            else
            {
                ldtc.Content = "Происходит фоновая синхронизация... работайте ....";
            }

            CommandManager.InvalidateRequerySuggested();
        }
Esempio n. 4
0
        private void MainWindowLoaded(object sender, RoutedEventArgs e)
        {
            lnm.Content = Config.Name;
            lnt.Content = Config.NameTicket;
            lnu.Content = Config.User;

            if (Config.IsUseServer)
            {
                _dispatcherTimer          = new DispatcherTimer();
                _dispatcherTimer.Tick    += DispatcherTimerTick;
                _dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1, 0);
                _dispatcherTimer.Start();
            }

            ClassBallanceMAGELLAN_8400.Opn();
            //Windows 8 API to enable touch keyboard to monitor for focus tracking in this WPF application
            try
            {
                var cp  = new InputPanelConfiguration();
                var icp = cp as IInputPanelConfiguration;
                if (icp != null)
                {
                    icp.EnableFocusTracking();
                }
            }
            catch
            {
                // ignored
            }

            foreach (var bs in ClassEtcFun.FindVisualChildren <Button>(this))
            {
                bs.Click += ButtonClick;
            }

            xProduct.Focus();
            ClassCustomerDisplay.Hi();

            status_message.Text += Environment.NewLine + "--------------------------------" + Environment.NewLine +
                                   "Caisse : " + Config.NameTicket + Environment.NewLine +
                                   "Post : " + Config.NumberTicket + Environment.NewLine +
                                   "Nom d'usager : " + Config.User + Environment.NewLine + Environment.NewLine +
                                   "--------------------------------" + Environment.NewLine +
                                   "La clé d'ouverture générale : " + GlobalVar.TicketWindowG + Environment.NewLine +
                                   "La clé d'ouverture local : " + GlobalVar.TicketWindow + Environment.NewLine;

            foreach (var gs in ClassEtcFun.FindVisualChildren <GridSplitter>(this))
            {
                gs.IsEnabled = Config.GridModif;
            }
        }
Esempio n. 5
0
        private void XProductKeyUp(object sender, KeyEventArgs e)
        {
            _countTick = 0;
            if (e.Key == Key.F11)
            {
                foreach (var gs in ClassEtcFun.FindVisualChildren <GridSplitter>(this))
                {
                    gs.IsEnabled = !gs.IsEnabled;
                }
            }

            if (e.Key == Key.F12)
            {
                Settings.Default.Reset();
            }

            if (e.Key == Key.Return)
            {
                KeyReturn();
            }
        }
Esempio n. 6
0
        private void WindowLoaded(object sender, RoutedEventArgs e)
        {
            GridLoad("m", ClassGridGroup.GridCurrencyPathGetPath(TypesPay));

            foreach (var bs in ClassEtcFun.FindVisualChildren <Button>(this))
            {
                bs.Click += ButtonClick;
            }

            var owner = Owner as MainWindow;

            if (owner != null)
            {
                var cc = RepositoryCurrencyRelations.Transform(FunctionsService.GetMoney((this.Owner as MainWindow).qty_label), this.TypesPay);

                foreach (var h in cc)
                {
                    FunctionsService.AddCurrency(h.Currency, h.Count, this);
                }

                owner.qty_label.Text = "__";
            }
        }
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); }
            }
            ;
        }
    }