public UserController(IUSERRepository userRepository, IROLERepository roleRepository,
                       ICategoryRepository cateogoryRepository, IOrderRepository orderRepository,
                       IDealRepository dealRepository, ICouponRepository couponRepository)
 {
     _userRepository     = userRepository;
     _roleRepository     = roleRepository;
     _categoryRepository = cateogoryRepository;
     _orderRepository    = orderRepository;
     _dealRepository     = dealRepository;
     _couponRepository   = couponRepository;
 }
 public UserController(IUSERRepository userRepository, IROLERepository roleRepository, 
     ICategoryRepository cateogoryRepository, IOrderRepository orderRepository,
     IDealRepository dealRepository, ICouponRepository couponRepository)
 {
     _userRepository = userRepository;
     _roleRepository = roleRepository;
     _categoryRepository = cateogoryRepository;
     _orderRepository = orderRepository;
     _dealRepository = dealRepository;
     _couponRepository = couponRepository;
 }
Esempio n. 3
0
        public static List <tRole> GetRoleObjectsForCurrentUser()
        {
            RoleProvider    _provider = (NRRoleProvider)Roles.Provider;
            IUSERRepository _UserRep  = BootStrapper.GetCurrentUserRepository();
            IROLERepository _RoleRep  = BootStrapper.GetCurrentRoleRepository();
            //IUSER_ROLERepository _UserRoleRep = BootStrapper.GetCurrentUserRoleRepository();
            // throw new NotImplementedException();
            tUser user = _UserRep.GetSingleByUserName(MembershipHelper.GetCurrenUser().UserName);
            //List<USER_ROLE> uroles = _UserRoleRep.GetListByUserID(user.UserID);
            List <tRole> roles = new List <tRole>();
            //int i = 0;
            //foreach (USER_ROLE item in uroles)
            //{
            //    ROLE role = _RoleRep.Find(item.RoleID);
            //    roles.Add(role);
            //}
            tRole role = _RoleRep.Find(user.IDRole);

            roles.Add(role);
            return(roles);
            // throw new NotImplementedException();
        }
Esempio n. 4
0
 public ROLEsController(IROLERepository roleRepository)
 {
     this.roleRepository = roleRepository;
 }