コード例 #1
0
ファイル: FeedBack.cs プロジェクト: minhchau2236/pgkh
        public static FeedBackCollection GetFeedBackPublicCollectionOfArticle(Guid articleId)
        {
            FeedBackCollection result = new FeedBackCollection();

            using (SqlConnection connection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["PSCPortalConnectionString"].ConnectionString))
            {
                SqlCommand command = new SqlCommand();
                command.Connection = connection;
                connection.Open();
                command.Parameters.AddWithValue("@ArticleId", articleId);
                command.CommandText = @"	SELECT *
	                                        from ArticleFeedBack 
	                                        where IsPublish=1 and ArticleId=@ArticleId
                                        ";

                using (SqlDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        result.Add(new FeedBack(reader));
                    }
                }
            }
            return(result);
        }
コード例 #2
0
ファイル: FeedBack.cs プロジェクト: minhchau2236/pgkh
        public static FeedBackCollection GetFeedBackUnPublicCollection()
        {
            FeedBackCollection result = new FeedBackCollection();

            using (SqlConnection connection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["PSCPortalConnectionString"].ConnectionString))
            {
                SqlCommand command = new SqlCommand();
                command.Connection  = connection;
                command.CommandText = @"	
                                        SELECT *
	                                    from ArticleFeedBack
	                                    where IsPublish=0"    ;
                connection.Open();
                using (SqlDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        result.Add(new FeedBack(reader));
                    }
                }
            }
            return(result);
        }