Ejemplo n.º 1
0
        public void AddUser(Models.UserModel userModel)
        {
            var user = new User();

            user.FirstName   = userModel.FirstName;
            user.LastName    = userModel.LastName;
            user.Employee_ID = userModel.EmployeeId;
            _repository.AddUser(user);
        }
Ejemplo n.º 2
0
        public BusinessLayer.Models.UserModel GetSpecificUser(int userId)
        {
            var userDb = _repository.GetSpecificUser(userId);
            var user   = new Models.UserModel()
            {
                FirstName = userDb.FirstName, LastName = userDb.LastName, EmployeeId = userDb.Employee_ID.GetValueOrDefault(), User_ID = userDb.User_ID
            };

            return(user);
        }
Ejemplo n.º 3
0
        public List <Models.UserModel> GetUsers()
        {
            var users      = _repository.GetUsers();
            var userModels = new List <Models.UserModel>();

            foreach (var usr in users)
            {
                var usrModel = new Models.UserModel()
                {
                    User_ID    = usr.User_ID,
                    FirstName  = usr.FirstName,
                    LastName   = usr.LastName,
                    EmployeeId = usr.Employee_ID.GetValueOrDefault()
                };
                userModels.Add(usrModel);
            }
            return(userModels);
        }