예제 #1
0
 private UserFactory GetMemberFactory()
 {
     if (this.UserRole == UserRole.Member)
     {
         return(MemberFactory.Instance());
     }
     throw new System.Exception("UserRole must be Member or Underling");
 }
예제 #2
0
        public static UserFactory Create(UserRole role)
        {
            UserFactory result;

            if (role == UserRole.Member)
            {
                result = MemberFactory.Instance();
            }
            else
            {
                if (role == UserRole.SiteManager)
                {
                    result = ManagerFactory.Instance();
                }
                else
                {
                    result = null;
                }
            }
            return(result);
        }