Exemple #1
0
 public PartnerController(
     IUSERRepository userRepository, IDealRepository dealRepository, ICouponRepository couponRepository)
 {
     _userRepository  = userRepository;
     _dealRepository  = dealRepository;
     _coupoRepository = couponRepository;
 }
 public PartnerController(
     IUSERRepository userRepository, IDealRepository dealRepository, ICouponRepository couponRepository)
 {
     _userRepository = userRepository;
     _dealRepository = dealRepository;
     _coupoRepository = couponRepository;
 }
        public UserProductController()
        {
            _uSERRepository        = new USERRepository();
            _userProductRepository = new UserProductRepository();

            _userProductService = new UserProductService(_uSERRepository, _userProductRepository);
        }
Exemple #4
0
        public override string[] GetRolesForUser(string username)
        {
            _UserRep = BootStrapper.GetCurrentUserRepository();
            _RoleRep = BootStrapper.GetCurrentRoleRepository();
            // throw new NotImplementedException();
            tUser user = _UserRep.GetSingleByUserName(username);

            if (user == null)
            {
                return new string[1] {
                           "NotFoundRole"
                }
            }
            ;
            //List<USER_ROLE> uroles = _UserRoleRep.GetListByUserID(user.UserID);
            string[] roles = new string[1];//new string[uroles.Count];
            int      i     = 0;
            //foreach (USER_ROLE item in uroles)
            //{
            //    ROLE role = _RoleRep.GetSingle(item.RoleID);
            //    roles[i] = role.RoleName;
            //    i++;
            //}
            tRole role = _RoleRep.Find(user.IDRole);

            roles[0] = role.Name;
            return(roles);
            // throw new NotImplementedException();
        }
Exemple #5
0
 public USERService(IUSERRepository uSERRepository, IUserProductRepository userProductRepository, bool initialization = true)
 {
     _uSERRepository        = uSERRepository;
     _userProductRepository = userProductRepository;
     if (initialization)
     {
         _uSERRepository        = new USERRepository();
         _userProductRepository = new UserProductRepository();
     }
 }
 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;
 }
Exemple #8
0
 public DealController(IUSERRepository userRepository, IDealRepository dealRepository, IGroupRepository groupRepository,
                       ICategoryRepository categoryRepository, ICouponRepository couponRepository,
                       IOrderRepository orderRepository, IPaymentMessageRepository paymentMessageRepository)
 {
     _userRepository           = userRepository;
     _dealRepository           = dealRepository;
     _groupRepository          = groupRepository;
     _categoryRepository       = categoryRepository;
     _couponRepository         = couponRepository;
     _orderRepository          = orderRepository;
     _paymentMessageRepository = paymentMessageRepository;
 }
Exemple #9
0
 public DealController(IUSERRepository userRepository, IDealRepository dealRepository, IGroupRepository groupRepository,
     ICategoryRepository categoryRepository, ICouponRepository couponRepository,
     IOrderRepository orderRepository, IPaymentMessageRepository paymentMessageRepository)
 {
     _userRepository = userRepository;
     _dealRepository = dealRepository;
     _groupRepository = groupRepository;
     _categoryRepository = categoryRepository;
     _couponRepository = couponRepository;
     _orderRepository = orderRepository;
     _paymentMessageRepository = paymentMessageRepository;
 }
Exemple #10
0
 public override string[] GetRolesForUser(string username)
 {
     _UserRep = BootStrapper.GetCurrentUserRepository();
     _RoleRep = BootStrapper.GetCurrentRoleRepository();
     // throw new NotImplementedException();
     tUser user = _UserRep.GetSingleByUserName(username);
     if (user == null) return new string[1]{"NotFoundRole"};
     //List<USER_ROLE> uroles = _UserRoleRep.GetListByUserID(user.UserID);
     string[] roles = new string[1];//new string[uroles.Count];
     int i = 0;
     //foreach (USER_ROLE item in uroles)
     //{
     //    ROLE role = _RoleRep.GetSingle(item.RoleID);
     //    roles[i] = role.RoleName;
     //    i++;
     //}
     tRole role = _RoleRep.Find(user.IDRole);
     roles[0] = role.Name;
     return roles;
     // throw new NotImplementedException();
 }
Exemple #11
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();
        }
Exemple #12
0
 public CouponController(IUSERRepository userRepository, ICouponRepository couponRepository)
 {
     _userRepository   = userRepository;
     _couponRepository = couponRepository;
 }
 public override bool ValidateUser(string username, string password)
 {
     bool isValid = false;
     _UserRep = BootStrapper.GetCurrentUserRepository();
     tUser user = _UserRep.GetSingleByUsernamePassword(username, password);
     if (user != null) {
         isValid = (bool)user.Approved;// && user.UserStatus == (int)B2B.Core.Enums.enmUserStatus.Active;
     }
     return isValid;
 }
        public override string GetUserNameByEmail(string email)
        {
            string username = String.Empty;
            _UserRep = BootStrapper.GetCurrentUserRepository();
            tUser user = _UserRep.GetSingleByEmail(email);
            if (user == null) {
                return String.Empty;
            } else {
                username = user.UserName.Trim();
            }

            return username;
        }
        public override MembershipUser GetUser(string username, bool userIsOnline)
        {
            MembershipUser membershipUser = null;
            _UserRep = BootStrapper.GetCurrentUserRepository();
            tUser user = _UserRep.GetSingleByUserName(username);
            if (user != null) {
                membershipUser = MakeMembershipUser(user);
                if (userIsOnline) {
                    //Update Last Activity Date;
                }
            }

            return membershipUser;
        }
        public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
        {
            _UserRep = BootStrapper.GetCurrentUserRepository();

            ValidatePasswordEventArgs args = new ValidatePasswordEventArgs(username, password, true);

            OnValidatingPassword(args);

            if (args.Cancel) {
                status = MembershipCreateStatus.InvalidPassword;
                return null;
            }

            if ((RequiresUniqueEmail && (GetUserNameByEmail(email) != String.Empty))) {
                status = MembershipCreateStatus.DuplicateEmail;
                return null;
            }

            MembershipUser membershipUser = GetUser(username, false);

            if (membershipUser == null) {
                System.DateTime createDate = DateTime.Now;

                tUser user = new tUser();
                user.UserName = username;
                user.Password = password;
                user.UserName = email;
                user.Approved = isApproved;
                //user.Address = "";
                //user.AdSoyad = "";
                //user.Avatar = "";
                //user.BirthDate = new DateTime(1900, 1, 1);
                //user.CellNo = "";
                //user.City = "";
                user.DateAdded = DateTime.Now;
                user.LastLoginDate = DateTime.Now;
                //user.Role = "User";
                //user.Semt = "";
                //user.TellNo = "";
                //user.UserStatus = (int)B2B.Core.Enums.enmUserStatus.Active;
                user.IDRole = (int) Enums.enmRoles.User;

                try {
                    _UserRep.InsertOrUpdate(user);
                    int result = 1;
                    if (result > 0) {
                        _UserRep.Save();
                        status = MembershipCreateStatus.Success;
                    } else {
                        status = MembershipCreateStatus.UserRejected;
                    }
                } catch (Exception err) {
                    //Add exception handling here.

                    status = MembershipCreateStatus.ProviderError;
                }

                return GetUser(username, false);
            } else {
                status = MembershipCreateStatus.DuplicateUserName;
            }

            return null;
        }
 public CouponController(IUSERRepository userRepository, ICouponRepository couponRepository)
 {
     _userRepository = userRepository;
     _couponRepository = couponRepository;
 }
Exemple #18
0
 public USERsController(IUSERRepository userRepository)
 {
     this.userRepository = userRepository;
 }