Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        private void Login()
        {
            LoginViewModel login = new LoginViewModel();

            if (login.ShowDialog().Value)
            {
                ListDatabaseViewModel ldm = new ListDatabaseViewModel();
                if (ldm.ShowDialog().Value)
                {
                    this.TagGroup.Clear();

                    mDatabase = ldm.SelectDatabase.Name;
                    var dbitem = new DatabaseViewModel()
                    {
                        Name = mDatabase, IsSelected = true, IsExpanded = true
                    };
                    this.TagGroup.Add(dbitem);
                    dbitem.Children.Add(mRootTagGroupModel);
                    mRootTagGroupModel.Database = mDatabase;
                    dbitem.Children.Add(securityModel);
                    securityModel.Database = mDatabase;
                    securityModel.Init();
                    Task.Run(() => {
                        TagViewModel.Drivers = DevelopServiceHelper.Helper.GetRegistorDrivers(mDatabase);
                        QueryGroups();
                    });
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        private void SwitchDatabase()
        {
            ListDatabaseViewModel ldm = new ListDatabaseViewModel();

            if (ldm.ShowDialog().Value)
            {
                if (Database != ldm.SelectDatabase.Name)
                {
                    if (ContentViewModel is IModeSwitch)
                    {
                        (ContentViewModel as IModeSwitch).DeActive();
                    }

                    Database = ldm.SelectDatabase.Name;
                    OnPropertyChanged("MainwindowTitle");

                    foreach (var vv in this.TagGroup)
                    {
                        vv.Dispose();
                    }
                    this.TagGroup.Clear();

                    var dbitem = new DatabaseViewModel()
                    {
                        Name = mDatabase, IsSelected = true, IsExpanded = true
                    };
                    this.TagGroup.Add(dbitem);

                    var sec = new ServerSecurityTreeViewModel();
                    sec.Children.Add(new ServerUserEditorTreeViewModel()
                    {
                        Name = UserName
                    });

                    if (DevelopServiceHelper.Helper.IsAdmin())
                    {
                        sec.Children.Add(new ServerUserManagerTreeViewModel());
                    }

                    this.TagGroup.Add(sec);
                    dbitem.Children.Add(mRootTagGroupModel);
                    mRootTagGroupModel.Database = mDatabase;
                    dbitem.Children.Add(securityModel);
                    securityModel.Database = mDatabase;
                    securityModel.Init();

                    dbitem.Children.Add(new DatabaseSettingViewModel()
                    {
                        Database = this.Database
                    });

                    Task.Run(() => {
                        TagViewModel.Drivers = DevelopServiceHelper.Helper.GetRegistorDrivers(mDatabase);
                        QueryGroups();
                    });

                    IsDatabaseRunning = DevelopServiceHelper.Helper.IsDatabaseRunning(mDatabase);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        private void DatabaseSelect()
        {
            ListDatabaseViewModel ldm = new ListDatabaseViewModel();

            if (ldm.ShowDialog().Value)
            {
                mSelectDatabase = ldm.SelectDatabase.Name;
                mDataQueryModel.LoadData(mSelectDatabase);
                IsEnable = true;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        private void Login()
        {
            LoginViewModel login = new LoginViewModel();

            if (login.ShowDialog().Value)
            {
                ListDatabaseViewModel ldm = new ListDatabaseViewModel();
                if (ldm.ShowDialog().Value)
                {
                    this.TagGroup.Clear();

                    CurrentUserManager.Manager.UserName = login.UserName;
                    Database = ldm.SelectDatabase.Name;
                    OnPropertyChanged("MainwindowTitle");
                    OnPropertyChanged("UserName");
                    IsLogin = true;

                    var dbitem = new DatabaseViewModel()
                    {
                        Name = mDatabase, IsSelected = true, IsExpanded = true
                    };
                    this.TagGroup.Add(dbitem);

                    var sec = new ServerSecurityTreeViewModel();
                    sec.Children.Add(new ServerUserEditorTreeViewModel());

                    if (DevelopServiceHelper.Helper.IsAdmin())
                    {
                        sec.Children.Add(new ServerUserManagerTreeViewModel());
                    }

                    this.TagGroup.Add(sec);
                    dbitem.Children.Add(mRootTagGroupModel);
                    mRootTagGroupModel.Database = mDatabase;
                    dbitem.Children.Add(securityModel);
                    securityModel.Database = mDatabase;
                    securityModel.Init();

                    dbitem.Children.Add(new DatabaseSettingViewModel()
                    {
                        Database = this.Database
                    });

                    Task.Run(() => {
                        TagViewModel.Drivers = DevelopServiceHelper.Helper.GetRegistorDrivers(mDatabase);
                        QueryGroups();
                    });

                    StartCheckDatabaseRunning();
                }
            }
        }