public BusinessUserModel GetBusinessByIdForView(int id)
        {
            IEnumerable <BusinessUserDTO> _businessDTOS = _BusinessUserCollectionDAL.GetBusinessByIdForView(id);

            foreach (var businessDTO in _businessDTOS)
            {
                BusinessUserModel business = new BusinessUserModel(businessDTO);
                businessUsers.Add(business);
            }

            return(businessUsers.LastOrDefault());
        }
        public IEnumerable <BusinessUserModel> GetBusinessUserByUserNameOrEmail(string identifier)
        {
            //  Returns businesses where username or email equals the identifier

            IEnumerable <BusinessUserDTO> businessUserDTOs = _BusinessUserCollectionDAL.GetBusinessByUserNameOrEmail(identifier);

            foreach (var businessUserDTO in businessUserDTOs)
            {
                BusinessUserModel businessUser = new BusinessUserModel(businessUserDTO);
                businessUsers.Add(businessUser);
            }
            return(businessUsers);
        }
        public IEnumerable <BusinessUserModel> GetAllBusinesses()
        {
            //  Returns all businesses

            IEnumerable <BusinessUserDTO> businessUserDTOs = _BusinessUserCollectionDAL.GetAllBusinesses();

            foreach (var businessUserDTO in businessUserDTOs)
            {
                BusinessUserModel businessUser = new BusinessUserModel(businessUserDTO);
                businessUsers.Add(businessUser);
            }

            return(businessUsers);
        }
        public void CreateBusinessUser(BusinessUserModel newBusinessUser)
        {
            //  Creates new business user

            BusinessUserDTO newBusinessUserDTO = new BusinessUserDTO
            {
                BusinessName = newBusinessUser.BusinessName,
                UserName     = newBusinessUser.UserName,
                Password     = newBusinessUser.Password,
                Email        = newBusinessUser.Email,
                Info         = newBusinessUser.Info,
                Sector       = newBusinessUser.Sector
            };

            _BusinessUserCollectionDAL.CreateBusinessUser(newBusinessUserDTO);
        }
 public void Update(BusinessUserModel updatedBusinessUser)
 {
 }