Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void AAbutton1_Click(object sender, RoutedEventArgs e)
- {
- Account selected = new Account();
- if (textBox2.Text != null)
- selected.username = textBox2.Text;
- if (textBox12.Text != null)
- selected.password = textBox12.Text;
- if (locationTxtBox2.Text != null)
- selected.location = locationTxtBox2.Text;
- MainWindow.Instance.editAccount(selected);
- MainWindow.Instance.updateData();
- MainWindow.Instance.needsSave = true;
- }
- public void editAccount(Account acc)
- {
- Account acc2;
- Account selected = (Account)dataGrid.SelectedItem;
- acc2 = Manager.accounts.ElementAt(Manager.accounts.FindIndex(a=> a == selected));
- acc2.username = acc.username;
- acc2.password = acc.password;
- acc2.location = acc.location;
- }
- public class Account
- {
- public String username { get; set; }
- public String password { get; set; }
- public String location { get; set; }
- public Account(String username,String password, String location)
- {
- this.username = username;
- this.password = password;
- this.location = location;
- }
- public Account()
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement