コード例 #1
0
        private void Conectar(object obj)
        {
            // if (DbStatus != Server.DbServerEstatus.Activo)
            // {
            var pass   = obj as PasswordBox;
            var server = LogingViewModel.newserver;

            server.Mysqlserver = txtMyServer;
            server.Mysqldbuser = txtMyuser;
            server.Mysqldbkey  = pass.Password;
            server.Mysqldbport = txtMyPort;
            Properties.Settings.Default.DbKey = pass.Password;
            Properties.Settings.Default.Save();

            DbStatus = server.StartDbService();
            ValidTxt = DbStatus.ToString();
            if (DbStatus == Server.DbServerEstatus.Activo)
            {
                MessageBox.Show("Conexion Realizada", "Conexion", MessageBoxButton.OK, MessageBoxImage.Information);
            }

            //  }
        }
コード例 #2
0
        public ConfigViewModel()
        {
            DbConnectCommand = new RelayCommand(Conectar);

            ValidTxt = DbStatus.ToString();
        }