Ejemplo n.º 1
0
 private UserFactory GetMemberFactory()
 {
     if (this.UserRole == Hidistro.Membership.Core.Enums.UserRole.Member)
     {
         return(MemberFactory.Instance());
     }
     if (this.UserRole != Hidistro.Membership.Core.Enums.UserRole.Underling)
     {
         throw new Exception("UserRole must be Member or Underling");
     }
     return(UnderlingFactory.Instance());
 }
Ejemplo n.º 2
0
 public static UserFactory Create(UserRole role)
 {
     if (role == UserRole.Distributor)
     {
         return(DistributorFactory.Instance());
     }
     if (role == UserRole.Member)
     {
         return(MemberFactory.Instance());
     }
     if (role == UserRole.SiteManager)
     {
         return(ManagerFactory.Instance());
     }
     if (role == UserRole.Underling)
     {
         return(UnderlingFactory.Instance());
     }
     return(null);
 }