예제 #1
0
파일: location.cs 프로젝트: EnterKye/PDI
    public ArrayList GetLocation()
    {
        string      location      = "select distinct location from location";
        ArrayList   locationArray = new ArrayList();//存储地址
        IDataReader drLocation    = db.ExecuteReader("SqlServer", location);

        while (drLocation.Read())
        {
            locationArray.Add(drLocation["location"].ToString());
        }
        return(locationArray);
    }
예제 #2
0
        public SqlDataReader GetWillCheckCommentReader(bool isAll = false)
        {
            StringBuilder strSql = new StringBuilder();

            if (isAll)
            {
                strSql.Append(@" SELECT CommentID AS ID, CommentContent AS Content, 1 AS ContentType FROM dbo.M_EventItem_Comments WITH(NOLOCK) WHERE CheckTypeID >-1
                    UNION ALL
                    SELECT ReplyID AS ID, ReplyContent AS Content, 2 AS ContentType FROM dbo.M_EventItem_Replies WITH(NOLOCK) WHERE CheckTypeID > -1");
            }
            else
            {
                strSql.Append(@" SELECT CommentID AS ID, CommentContent AS Content, 1 AS ContentType FROM dbo.M_EventItem_Comments WITH(NOLOCK) WHERE CheckTypeID = 0
                    UNION ALL
                    SELECT ReplyID AS ID, ReplyContent AS Content, 2 AS ContentType FROM dbo.M_EventItem_Replies WITH(NOLOCK) WHERE CheckTypeID = 0");
            }
            return(SQlHelper.ExecuteReader(SQlHelper.MyConnectStr, CommandType.Text, strSql.ToString()));
        }