Exemplo n.º 1
0
        private void Home_Click(object sender, RoutedEventArgs e)
        {
            Application   app = App.Current;
            IS3MainWindow mw  = app.MainWindow as IS3MainWindow;

            mw.SwitchToProjectListPage();
        }
Exemplo n.º 2
0
        void MyMapView_Loaded(object sender, RoutedEventArgs e)
        {
            if (Projects == null)
            {
                LoadProjectList();
                // switch to the default project
                if (Projects != null)
                {
                    ProjectLocation loc =
                        Projects.Locations.ToList().Find(i => i.Default == true);
                    if ((loc != null))
                    {
                        App           app = Application.Current as App;
                        IS3MainWindow mw  = (IS3MainWindow)app.MainWindow;
                        mw.SwitchToMainFrame(loc.ID);
                    }
                    projectBox.ItemsSource = Projects.Locations;
                }
            }
            if (Projects != null)
            {
                Envelope projectExtent = new Envelope(Projects.XMin, Projects.YMin,
                                                      Projects.XMax, Projects.YMax);

                AddProjectsToMap();
                //Map.ZoomTo(ProjectExtent);
            }
        }
        async void MyMapView_MouseDown(object sender, MouseButtonEventArgs e)
        {
            try
            {
                _isHitTesting = true;

                Point   screenPoint = e.GetPosition(MyMapView);
                Graphic graphic     = await ProjectGraphicsLayer.HitTestAsync(MyMapView, screenPoint);

                if (graphic != null)
                {
                    string definitionFile = graphic.Attributes["DefinitionFile"] as string;
                    App    app            = Application.Current as App;

                    IS3MainWindow mw = (IS3MainWindow)app.MainWindow;
                    mw.SwitchToMainFrame(definitionFile);
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                _isHitTesting = false;
            }
        }
Exemplo n.º 4
0
        private void ViewMenu_Click(object sender, RoutedEventArgs e)
        {
            string        projectID = _selectGraphic.Attributes["ID"] as string;
            App           app       = Application.Current as App;
            IS3MainWindow mw        = (IS3MainWindow)app.MainWindow;

            mw.SwitchToMainFrame(projectID);
        }
        //登陆验证
        private void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            XDocument xml = XDocument.Load(Runtime.configurationPath);

            if ((LoginNameTB.Text == "") || (LoginPasswordTB.Password == ""))
            {
                MessageBox.Show("账号或密码不为空");
                return;
            }
            if ((LoginNameTB.Text != xml.Root.Element("user").Value) || (LoginPasswordTB.Password != xml.Root.Element("password").Value))
            {
                MessageBox.Show("账号或密码错误");
                return;
            }
            App           app = Application.Current as App;
            IS3MainWindow mw  = (IS3MainWindow)app.MainWindow;

            mw.SwitchToProjectListPage();
        }
Exemplo n.º 6
0
        //登陆验证
        private void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            ServiceImporter.UpdateMainConnect(Runtime.configurationPath);

            XDocument xml = XDocument.Load(Runtime.configurationPath);
            string    key = "Data Source =" + xml.Root.Element("ipaddress")?.Value + "; Initial Catalog = " +
                            xml.Root.Element("database")?.Value + "; User Id = " + xml.Root.Element("user")?.Value +
                            "; Password = "******"password")?.Value + ";Connect Timeout=1";
            SqlConnection sqlConnection = new SqlConnection(key);

            try
            {
                sqlConnection.QuickOpen(1000);
            }
            catch (Exception)
            {
                MessageBox.Show("连接超时");
                sqlConnection.Close();
                sqlConnection.Dispose();
                return;
            }
            sqlConnection.Close();

            if ((LoginNameTB.Text == "") || (LoginPasswordTB.Password == ""))
            {
                MessageBox.Show("账号或密码不为空");
                return;
            }
            Globals.userID = Globals.iS3Service.PrivilegeService.CheckIfValidLoginInfo(LoginNameTB.Text, LoginPasswordTB.Password);
            if (Globals.userID > 0)
            {
                App           app = Application.Current as App;
                IS3MainWindow mw  = (IS3MainWindow)app.MainWindow;
                mw.SwitchToProjectListPage();
            }
            else
            {
                MessageBox.Show("密码错误");
            }
        }