Beispiel #1
0
        public List <User> GetToken(string userName, string password)
        {
            if (userName == "testUser" && password == "testPassword")
            {
                // Authentication Successful
                UserDBO dbc  = new UserDBO();
                User    user = new User();
                //dbc.Delete(6);

                //user.name = "Ionut";
                //user.email = "[email protected]";
                //user.password = "******";
                //user.admin = "N";
                //int w = dbc.Insert(user);
                //Console.WriteLine(w);

                //User a = new User();
                //a = dbc.GetUserById(2);
                //Console.WriteLine(a.ToString() + a.email) ;

                //int q = dbc.Update(a, 7);
                //Console.WriteLine(q);

                List <User> list = dbc.SelectAll();



                return(list);
            }
            else
            {
                // Authentication Failed
                return(null);
            }
        }
Beispiel #2
0
        public List <User> GetAllUsers()
        {
            UserDBO     dbc  = new UserDBO();
            List <User> list = dbc.SelectAll();

            return(list);
        }