Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }