Esempio n. 1
0
        public static void writeData(Hashtable newUserPass)
        {
            ICollection    newAccounts = newUserPass.Values;
            List <Account> updatedList = new List <Account>();

            foreach (Account account in newAccounts)
            {
                updatedList.Add(account);
            }

            accounts = updatedList;
            UserFileConnector.WriteXml(updatedList);
        }
Esempio n. 2
0
        // public static void Create()
        // {
        //   // List<Account> accounts = new List<Account>();

        //   accounts.Add(new Account{username="******", password="******", storeID=3, orderTime=new DateTime(2019, 11, 4, 18, 31, 0)});
        //   accounts.Add(new Account{username="******", password="******", storeID=1, orderTime=new DateTime(2019, 3, 1)});
        //   accounts.Add(new Account{username="******", password="******", storeID=2, orderTime=new DateTime(2019, 11, 3)});
        // }

        public static Hashtable readData()
        {
            Hashtable userAccount = new Hashtable();

            accounts = UserFileConnector.ReadXml();

            foreach (Account account in accounts)
            {
                userAccount.Add(account.username, account);
            }

            return(userAccount);
        }