Example #1
0
        public bool Authenticate(Users_DB user)
        {
            string          query  = String.Format("select * from users where username='******' and 'password={1}'", user.username, user.password);
            BuisnessLogic   bl     = new BuisnessLogic();
            OleDbDataReader reader = bl.SelectQuery(query);

            if (reader.Read())
            {
                Users_DB ud = new Users_DB();
                ud.id       = reader[0].ToString();
                ud.fname    = reader[1].ToString();
                ud.lname    = reader[2].ToString();
                ud.email    = reader[3].ToString();
                ud.phone    = reader[4].ToString();
                ud.aadhar   = reader[5].ToString();
                ud.username = reader[6].ToString();
                ud.password = reader[7].ToString();
                Session.CreateSession(ud);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        public String getID(string email)
        {
            string          query  = String.Format("select id from users where email='{0}'", email);
            BuisnessLogic   bl     = new BuisnessLogic();
            OleDbDataReader reader = bl.SelectQuery(query);

            if (reader.Read())
            {
                return(reader[0].ToString());
            }
            else
            {
                return("0");
            }
        }
        public String getBalance(string id)
        {
            string query = String.Format("select balance from Account where userid={0}", @id);

            Console.WriteLine(query);
            BuisnessLogic   bl     = new BuisnessLogic();
            OleDbDataReader reader = bl.SelectQuery(query);

            if (reader.Read())
            {
                return(reader[0].ToString());
            }
            else
            {
                Console.WriteLine("Error");
                return("0");
            }
        }