Esempio n. 1
0
        private void ActionView()
        {
            Console.Clear();
            Console.WriteLine("Users in database:");
            var users = BLL.GetAll();

            foreach (var item in users)
            {
                PrintUserData(item);
            }
        }
Esempio n. 2
0
        public ResponseBody <List <sline_member> > GetAllUser()
        {
            var list = _IUserBLL.GetAll();

            return(new ResponseBody <List <sline_member> > {
                Result = list, Code = "", Message = ""
            });
        }
Esempio n. 3
0
 public IActionResult GetAllUser()
 {
     try
     {
         return(Ok(userBLL.GetAll().Data));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Esempio n. 4
0
        public IActionResult Get()
        {
            List <UserDto> userDtos = new List <UserDto>();
            List <User>    users    = userBLL.GetAll().ToList();

            foreach (User item in users)
            {
                userDtos.Add(new UserDto()
                {
                    UserID   = item.ID,
                    UserName = item.UserName,
                    EMail    = item.Email,
                    Role     = item.Role.ToString(),
                    IsActive = item.IsActive
                });
            }
            return(Ok(userDtos));
        }
Esempio n. 5
0
        private void ShowUsers()
        {
            System.Console.WriteLine("ID|Name|Age");

            foreach (var user in _userBLL.GetAll())
            {
                System.Console.WriteLine(user);
                System.Console.WriteLine("User's awards:");
                Dictionary <int, List <int> > awardIdUserIDs = _awardBLL.GetDictionaryOfAwardsAndUsers();
                foreach (var item in awardIdUserIDs)
                {
                    if (item.Value.Contains(user.ID))
                    {
                        System.Console.WriteLine(_awardBLL.GetById(item.Key));
                    }
                }

                System.Console.WriteLine();
            }
        }
Esempio n. 6
0
 public ActionResult List()
 {
     // return View();
     return(View(userBLL.GetAll()));
 }
        public IActionResult GetUserAll()
        {
            List <User> users = userBLL.GetAll().ToList();

            return(Ok(ConvertDtoList(users)));
        }