Esempio n. 1
0
 public static AllRegisteredUsers GetInstance()
 {
     if (instance == null)
     {
         instance = new AllRegisteredUsers();
     }
     return(instance);
 }
Esempio n. 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);
 }
Esempio n. 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);
        }
Esempio n. 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);
 }
Esempio n. 5
0
 public static AllRegisteredUsers Reset()
 {
     instance = new AllRegisteredUsers();
     return(instance);
 }
Esempio n. 6
0
 public StoreOwner GetOwner()
 {
     return(AllRegisteredUsers.GetInstance().GetUserInfo(owner).GetOwner(store));
 }