private UserFactory GetMemberFactory() { if (this.UserRole == UserRole.Member) { return(MemberFactory.Instance()); } throw new System.Exception("UserRole must be Member or Underling"); }
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); }