示例#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
        private void unlockedAccount(string username)
        {
            string newAccounts = "";

            for (ctr = 0; ctr < accounts.Length - 1; ctr++)
            {
                string[] userInfo = uAccounts.ParseUserInfo(accounts[ctr]);
                if (userInfo[0].Equals(username))
                {
                    string newAccount = userInfo[0] + ";" + userInfo[1] + ";" + userInfo[2] + ";" + userInfo[3] + ";" + userInfo[4] + ";1|";
                    newAccounts += newAccount;
                }
                else
                {
                    newAccounts += accounts[ctr] + "|";
                }
            }

            uAccounts.saveAccounts(newAccounts);
            loadUsers(new UserAccounts().getAccounts());
        }