예제 #1
0
        public bool CheckUserName(string username)
        {
            _objDBGateway = new DatabaseGateway(_dbType);
            int result = 0;

            try
            {
                string query = "select count(*) from TB_Login where USERNAME='******'";

                result = _objDBGateway.ExecuteScalar <int>(query);
                if (result > 0)
                {
                    isSuccess = true;
                }
                else
                {
                    isSuccess = false;
                }
            }
            catch (Exception ex)
            {
                throw;
            }


            return(isSuccess);
        }
예제 #2
0
        public bool Login(UserEntity entity)
        {
            _objDBGateway = new DatabaseGateway(_dbType);
            int result = 0;

            try
            {
                string query = "select count(*) from TB_Login where USERNAME='******' and PASSWORD='******'";

                result = _objDBGateway.ExecuteScalar <int>(query);
                if (result > 0)
                {
                    isSuccess = true;
                }
                else
                {
                    isSuccess = false;
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(isSuccess);
        }