private void SeacrAccount_Click(object sender, RoutedEventArgs e) { List <AccountModel> accounts = new List <AccountModel>(); DGR_Accounts.ItemsSource = null; using (var db = new ResourceModel()) { var acc = db.SearchAccount(TB_Login.Text, TB_Type.Text, CB_LN.Text); foreach (var a in acc) { accounts.Add(new AccountModel() { AccountID = a.AccountID, Login = a.Login, Type_Account = a.Type_Account, LastNamePeople = a.LastNamePeople, Passwords = db.GetPasswordD(ID, a.Login) }); } } DGR_Accounts.ItemsSource = accounts; }
private void Decrypt_Click(object sender, RoutedEventArgs e) { List <AccountModel> accounts = new List <AccountModel>(); using (var db = new ResourceModel()) { var acc = db.GetAccountInId(db.ConvertorObjectInInt(DGR_Accounts.SelectedValue)); foreach (var a in acc) { accounts.Add(new AccountModel() { AccountID = a.AccountID, Login = a.Login, Type_Account = a.Type_Account, LastNamePeople = a.LastNamePeople, Passwords = db.GetPasswordD(ID, a.Login) }); } } DGR_Accounts.ItemsSource = null; DGR_Accounts.ItemsSource = accounts; }