Пример #1
0
        private void updateAccount(String username, String password, String adminType, String fName, String municpality)
        {
            UserAccounts uAccounts = new UserAccounts();

            string[] accounts    = uAccounts.getAccounts();
            string   newAccounts = "";
            int      ctr;

            for (ctr = 0; ctr < accounts.Length - 1; ctr++)
            {
                string[] userInfo = uAccounts.ParseUserInfo(accounts[ctr]);
                if (userInfo[0].Equals(username))
                {
                    string newAccount = username + ";" + password + ";" + adminType + ";" + fName + ";" + municpality + ";" + status + "|";
                    newAccounts += newAccount;
                }
                else
                {
                    newAccounts += accounts[ctr] + "|";
                }
            }

            uAccounts.saveAccounts(newAccounts);
            MessageBox.Show("Account updated succesfully!");
            new AdminPanel(user).Show();
            this.Close();
        }
Пример #2
0
 public AdminPanel(string[] user)
 {
     InitializeComponent();
     this.user = user;
     uAccounts = new UserAccounts();
     accounts  = uAccounts.getAccounts();
     loadUsers(accounts);
 }
Пример #3
0
 private void Login_Load(object sender, EventArgs e)
 {
     uAccounts = new UserAccounts();
     accounts  = uAccounts.getAccounts();
 }