Example #1
0
        public static List<Models.UserItem> GetListUser()
        {
            List <T_User> listUser = DataAccess.User.GetListUser();
            List<Models.UserItem> listUserItem = new List<UserItem>();

            foreach (T_User user in listUser)
            {
                Models.UserItem userIt = new UserItem()
                {
                    Id = user.Id,
                    Name = user.Name,
                    FirstName = user.Firstname,
                    Login = user.Pseudo,
                    Mail = user.Mail,
                    City = user.Ville,
                    Role = user.Role,
                    Deleted = user.Deleted
                };

                listUserItem.Add(userIt);
            }
            return listUserItem;
        }
Example #2
0
        static public UserItem UserToUserItem(string pseudo)
        {
            T_User user = DataAccess.User.GetUserByPseudo(pseudo);
            Models.UserItem itemUser = new UserItem()
            {
                Name = user.Name,
                FirstName = user.Firstname,
                Role = user.Role,
                City = user.Ville,
                Id = user.Id,
                Deleted = user.Deleted,
                Mail = user.Mail
            };

            return itemUser;

        }