Exemplo n.º 1
0
        public void DisplayAllUsers()
        {
            var users = _bll.GetAllUsers();

            Console.WriteLine("Сохраненные пользователи:" + Environment.NewLine);

            foreach (Users item in users)
            {
                Console.WriteLine(string.Format("Имя: {0}, Дата рождения: {1}, Возраст: {2}",
                                                item.Name, item.DateOfBirth, item.Age));
            }
        }
Exemplo n.º 2
0
 public void DisplayUsers()
 {
     Console.WriteLine("USERS:::");
     Console.WriteLine("ID \t\t\t\t\t NAME \t AGE");
     foreach (User u in _userLogic.GetAllUsers())
     {
         Console.WriteLine($"{u.ID} \t {u.Name} \t {u.Age} ");
     }
 }
Exemplo n.º 3
0
 public HttpResponseMessage GetUsers()
 {
     try
     {
         List <UserDTO> _Output = _IUserBLL.GetAllUsers().ToList();
         return(Request.CreateResponse(HttpStatusCode.OK, _Output));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
Exemplo n.º 4
0
 public IActionResult Get()
 {
     return(Ok(_userBll.GetAllUsers().Select(user => _mapper.Map <UserViewModel>(user))));
 }
Exemplo n.º 5
0
 public ActionResult <IEnumerable <UserModel> > GetAllUsers()
 {
     return(_userBLL.GetAllUsers().Select(m => m.ToModel()).ToArray());
 }
Exemplo n.º 6
0
        public static UserListViewModel Create(IUserBLL userBLL, IRepository<Project> projectRepository, int? filterProjectId)
        {
            var users = filterProjectId == null
                            ? userBLL.GetAllUsers()
                            : userBLL.GetAllUsers().Where(x => x.Projects.Contains(projectRepository.GetById(filterProjectId.Value)));

            var viewModel = new UserListViewModel
                                {
                                    Users = users.ToList(),
                                    Projects = userBLL.GetAllProjectsByUser(projectRepository).ToList(),
                                    SelectedFilterProjectId = filterProjectId
                                };

            return viewModel;
        }
Exemplo n.º 7
0
 public List <UserModelResponse> GetAllUsers()
 {
     return(userBLL.GetAllUsers());
 }