示例#1
0
        internal static void ShowError(string messageText, string messageCaption)
        {
            ShowWind window = new ShowWind(messageText);

            window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            window.ShowDialog();
        }
示例#2
0
        internal static void ShowInformation(string messageText)
        {
            ShowWind window = new ShowWind(messageText);

            window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            window.ShowDialog();
        }
示例#3
0
        internal static bool ShowQuestion(string mess, string header)
        {
            ShowWind window = new ShowWind(mess, header);

            window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            window.ShowDialog();
            bool ret = (bool)window.DialogResult;

            return(ret);
        }
        //public string IMGcastle{get;set;}
        //private Point firstPoint = new Point();
        //private double[] firstMarginPoint = new double[2];

        //Grid CG = new Grid();

        //private void _mouseClick(object sender, MouseButtonEventArgs e)
        //{
        //    firstPoint = e.GetPosition(this);
        //    var _grid = (Grid)sender;
        //    _grid.CaptureMouse();
        //}
        //private void _mouseMove(object sender, System.Windows.Input.MouseEventArgs e)
        //{
        //    if (e.LeftButton == MouseButtonState.Pressed)
        //    {
        //        Point temp = e.GetPosition(this);
        //        if (temp.X > 0 || temp.X < 1200 || temp.Y > 0 || temp.Y < 800)
        //        {
        //            Point res = new Point(firstPoint.X - temp.X, firstPoint.Y - temp.Y);

        //            Canvas.SetLeft(CG, Canvas.GetLeft(CG) - res.X);
        //            Canvas.SetTop(CG, Canvas.GetTop(CG) - res.Y);
        //            firstPoint = temp;

        //        }
        //       // BOX.ShowInformation(firstPoint.X + " " + firstPoint.Y);
        //    }
        //}

        //private void _mouseUp(object sender, MouseButtonEventArgs e)
        //{
        //    var _grid = (Grid)sender;
        //    _grid.ReleaseMouseCapture();
        //    //CG = null;
        //}
        #endregion
        //
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var hwnd = new WindowInteropHelper(this).Handle;

            SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_SYSMENU);

            string logini = Storage.datasetKlient.Tables["ClientInfo"].Rows[0][7].ToString() + " ";

            logini += Storage.datasetKlient.Tables["ClientInfo"].Rows[0][8].ToString() + "\r\n";
            logini += Storage.datasetKlient.Tables["ClientInfo"].Rows[0][17].ToString() + "\r\n";
            logini += Storage.datasetKlient.Tables["ClientInfo"].Rows[0][6].ToString();

            IHardwareAcces Acces = new HardwareAcces(Storage.datasetKlient.Tables["ClientInfo"].Rows[0][6].ToString());

            Acces.InitializeAcces();
            if (Acces.HardwareStatus < 2)
            {
                if (Acces.HardwareStatus == 0)
                {
                    Acces.SetFalseHardvareStatus();
                    BOX.ShowInformation("Ваше устройство не распознано. Отправьте ваши данные для разблокировки или повторите попытку ввода позднее.");
                    HardwareAccesWindow AccesW = new HardwareAccesWindow(Acces.HddID);
                    AccesW.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                    AccesW.ShowDialog();

                    Environment.Exit(0);
                }
                else if (Acces.HardwareStatus == 1)
                {
                    BOX.ShowInformation("Ваше устройство распознано и ожидает решения о разблокировке.");
                    Environment.Exit(0);
                }
            }

            if (Settings1.Default.DisclaimerAccept == false)
            {
                Disclaimer disclamer = new Disclaimer();
                disclamer.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                disclamer.ShowDialog();
            }

            if (Settings1.Default.FirstVisit == true)
            {
                ShowWind sw = new ShowWind();
                sw.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                sw.ShowDialog();
                sw.WindowStartupLocation = WindowStartupLocation.CenterScreen;

                Settings_Client SC = new Settings_Client();
                SC.DataContext           = MainWindow.settings;
                SC.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                SC.ShowDialog();
                Settings1.Default.FirstVisit = false;
                Settings1.Default.Save();
            }

            IEnterHistory History = new HardwareAcces(Storage.datasetKlient.Tables["ClientInfo"].Rows[0][6].ToString());

            History.InitializeHistoryEnter();
            History.InsertSucsessEnterInfo();
        }