Exemplo n.º 1
0
        public static List <User> GetAllUser()
        {
            List <User> list = new List <User>();

            foreach (DataRow row in ((UserCache) new UserCache().GetData()).dtUser.Rows)
            {
                User user    = new User();
                User @object = UserUtils.GetObject(row);
                list.Add(@object);
            }
            return(list);
        }
Exemplo n.º 2
0
        public static List <User> GetUserByName(string userName)
        {
            List <User> list = new List <User>();

            DataRowView[] array = ((UserCache) new UserCache().GetData()).dvUserBy_UserName.FindRows(userName);
            for (int i = 0; i < array.Length; i++)
            {
                DataRowView dataRowView = array[i];
                User        user        = new User();
                User        @object     = UserUtils.GetObject(dataRowView.Row);
                list.Add(@object);
            }
            return(list);
        }
Exemplo n.º 3
0
        public static User GetUserByMac(string macAddress)
        {
            User      user      = null;
            UserCache userCache = (UserCache) new UserCache().GetData();
            int       index     = userCache.dvUserBy_Mac.Find(macAddress);
            bool      flag      = index >= 0;

            if (flag)
            {
                User user2 = new User();
                user = UserUtils.GetObject(userCache.dvUserBy_Mac[index].Row);
            }
            return(user);
        }
Exemplo n.º 4
0
        public static User GetUser(string userId)
        {
            User      user      = null;
            UserCache userCache = (UserCache) new UserCache().GetData();
            int       index     = userCache.dvUserBy_UserId.Find(userId);
            bool      flag      = index >= 0;

            if (flag)
            {
                User user2 = new User();
                user = UserUtils.GetObject(userCache.dvUserBy_UserId[index].Row);
            }
            return(user);
        }