public static AllRegisteredUsers GetInstance()
 {
     if (instance == null)
     {
         instance = new AllRegisteredUsers();
     }
     return(instance);
 }
Beispiel #2
0
 public bool RemoveUser(UserInfo user)
 {
     if (!user.IsAdmin() && AllRegisteredUsers.GetInstance().RemoveUser(user))
     {
         Logger.GetInstance().WriteToEventLog(this.user.GetUserName() + " removed user " + user.GetUserName() + " as an admin");
         return(true);
     }
     Logger.GetInstance().WriteToEventLog(this.user.GetUserName() + " was unable to remove user " + user.GetUserName() + " as an admin");
     return(false);
 }
Beispiel #3
0
        public LinkedList <UserInfo> GetPendingUsers()
        {
            LinkedList <UserInfo> users = new LinkedList <UserInfo>();

            if (pendingUsers != null)
            {
                foreach (string str in pendingUsers.Split('$'))
                {
                    users.AddLast(AllRegisteredUsers.GetInstance().GetUserInfo(str));
                }
            }
            return(users);
        }
Beispiel #4
0
 public bool OpenStore(string storeName)
 {
     if (storeName.Equals("") || MarketManagment.System.GetInstance().GetStore(storeName) != null)
     {
         throw new ErrorMessageException("A store with the given name already exists");
     }
     MarketManagment.System.GetInstance().OpenStore(storeName);
     storeOwners.AddLast(new StoreOwner(this, storeName, null));
     for (int i = 0; i < AllRegisteredUsers.GetInstance().GetAllUserNames().Count; i++)
     {
         Notifications.Notification.GetInstance().SendMessageToUser(AllRegisteredUsers.GetInstance().GetAllUserNames().ElementAt(i), "The shop " + storeName + " was opened now!");
     }
     DbCommerce.GetInstance().SaveDb();
     return(true);
 }
 public static AllRegisteredUsers Reset()
 {
     instance = new AllRegisteredUsers();
     return(instance);
 }
Beispiel #6
0
 public StoreOwner GetOwner()
 {
     return(AllRegisteredUsers.GetInstance().GetUserInfo(owner).GetOwner(store));
 }