コード例 #1
0
 private UserFactory GetMemberFactory()
 {
     if (this.UserRole != Hidistro.Membership.Core.Enums.UserRole.StoreAdmin)
     {
         throw new Exception("UserRole must be Member or Underling");
     }
     return StoreAdminFactory.Instance();
 }
コード例 #2
0
 public static UserFactory Create(UserRole role)
 {
     if (role == UserRole.Member)
     {
         return(MemberFactory.Instance());
     }
     if (role == UserRole.SiteManager)
     {
         return(ManagerFactory.Instance());
     }
     if (role == UserRole.StoreAdmin)
     {
         return(StoreAdminFactory.Instance());
     }
     return(null);
 }