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