public void Preenche(string id_database) { int conta = 0; ViewModels.BasesdeDados bd_database = new ViewModels.BasesdeDados(); ViewModels.Projeto projecto = new ViewModels.Projeto(); id_BD = id_database; var ls = database.getBDDetails(id_BD); string[] nomeFilial = projecto.NomeEntidade(ls.StampProjeto); id_filiais = ls.StampProjeto; AutoComplete1.Text = nomeFilial[0]; ServidorBD.Text = ls.Servername; usernameBD.Text = ls.UserID; Classes.DataControl dataControl = new Classes.DataControl(); string pass = dataControl.DecryptStringAES(ls.Password, "BigLevel"); PasswordBD.Text = pass; PasswordBDPass.Password = pass; DatabaseBD.Text = ls.Initialcatalog; if (ls.Encrypt == true) { EncryptBD.IsChecked = true; } if (ls.Trustservercertificate == true) { CertificateBD.IsChecked = true; } conta = Verifica_Validacao(); if (conta >= 5) { buttonsDetails.AlterDataButtonSave(1); AutoComplete1.BorderBrush = Brushes.Gray; } }
private void Import_Click_1(object sender, RoutedEventArgs e) { string id = basesDados.IDBDByName(combo_BD.SelectedItem.ToString()); BasesDados bd = basesDados.getBDDetails(id); importarDados = new ViewModels.ImportDados(); Classes.DataControl dataControl = new Classes.DataControl(); string pass = dataControl.DecryptStringAES(bd.Password, "BigLevel"); bool conn = importarDados.ConstroiConnString(bd.Servername, bd.Initialcatalog, bd.UserID, pass); if (conn == false) { } else { teste = bd.Initialcatalog; bool done = false; Thread t = new Thread(new ThreadStart(Work)); t.Start(); Thread t2 = new Thread(new ThreadStart(Work2)); t2.Start(); } }