当前位置: 首页>>代码示例>>C#>>正文


C# BlogRollItem.MarkOld方法代码示例

本文整理汇总了C#中BlogRollItem.MarkOld方法的典型用法代码示例。如果您正苦于以下问题:C# BlogRollItem.MarkOld方法的具体用法?C# BlogRollItem.MarkOld怎么用?C# BlogRollItem.MarkOld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BlogRollItem的用法示例。


在下文中一共展示了BlogRollItem.MarkOld方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FillBlogRoll

        /// <summary>
        /// Gets all BlogRolls in database
        /// </summary>
        /// <returns>
        /// List of BlogRolls
        /// </returns>
        public override List<BlogRollItem> FillBlogRoll()
        {
            var blogRoll = new List<BlogRollItem>();

            using (var conn = this.CreateConnection())
            {
                if (conn.HasConnection)
                {
                    using (var cmd = conn.CreateTextCommand(string.Format("SELECT BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex FROM {0}BlogRollItems WHERE BlogId = {1}blogid ", this.tablePrefix, this.parmPrefix)))
                    {
                        cmd.Parameters.Add(conn.CreateParameter(FormatParamName("blogid"), Blog.CurrentInstance.Id.ToString()));

                        using (var rdr = cmd.ExecuteReader())
                        {
                            while (rdr.Read())
                            {
                                var br = new BlogRollItem
                                    {
                                        Id = rdr.GetGuid(0),
                                        Title = rdr.GetString(1),
                                        Description = rdr.IsDBNull(2) ? string.Empty : rdr.GetString(2),
                                        BlogUrl = rdr.IsDBNull(3) ? null : new Uri(rdr.GetString(3)),
                                        FeedUrl = rdr.IsDBNull(4) ? null : new Uri(rdr.GetString(4)),
                                        Xfn = rdr.IsDBNull(5) ? string.Empty : rdr.GetString(5),
                                        SortIndex = rdr.GetInt32(6)
                                    };

                                blogRoll.Add(br);
                                br.MarkOld();
                            }
                        }
                    }
                }
            }

            return blogRoll;
        }
开发者ID:mukhtiarlander,项目名称:git_demo_torit,代码行数:43,代码来源:DbBlogProvider.cs

示例2: FillBlogRoll

        /// <summary>
        /// Gets all BlogRolls in database
        /// </summary>
        /// <returns>List of BlogRolls</returns>
        public override List<BlogRollItem> FillBlogRoll()
        {
            List<BlogRollItem> blogRoll = new List<BlogRollItem>();

            string connString = ConfigurationManager.ConnectionStrings[connStringName].ConnectionString;
            string providerName = ConfigurationManager.ConnectionStrings[connStringName].ProviderName;
            DbProviderFactory provider = DbProviderFactories.GetFactory(providerName);

            using (DbConnection conn = provider.CreateConnection())
            {
                conn.ConnectionString = connString;
                conn.Open();
                using (DbCommand cmd = conn.CreateCommand())
                {
                    string sqlQuery = "SELECT BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex " +
                        "FROM " + tablePrefix + "BlogRollItems ";
                    cmd.CommandText = sqlQuery;
                    cmd.CommandType = CommandType.Text;

                    using (DbDataReader rdr = cmd.ExecuteReader())
                    {
                        if (rdr.HasRows)
                        {
                            while (rdr.Read())
                            {
                                BlogRollItem br = new BlogRollItem()
                                {
                                    Id = rdr.GetGuid(0),
                                    Title = rdr.GetString(1),
                                    Description = rdr.IsDBNull(2) ? string.Empty : rdr.GetString(2),
                                    BlogUrl = rdr.IsDBNull(3) ? null : new Uri(rdr.GetString(3)),
                                    FeedUrl = rdr.IsDBNull(4) ? null : new Uri(rdr.GetString(4)),
                                    Xfn = rdr.IsDBNull(5) ? string.Empty : rdr.GetString(5),
                                    SortIndex = rdr.GetInt32(6)
                                };

                                blogRoll.Add(br);
                                br.MarkOld();
                            }
                        }
                    }
                }
            }

            return blogRoll;
        }
开发者ID:rajgit31,项目名称:RajBlog,代码行数:50,代码来源:DbBlogProvider.cs

示例3: FillBlogRoll

        /// <summary>
        /// Gets all BlogRolls in database
        /// </summary>
        /// <returns>
        /// List of BlogRolls
        /// </returns>
        public override List<BlogRollItem> FillBlogRoll()
        {
            var blogRoll = new List<BlogRollItem>();

            var connString = ConfigurationManager.ConnectionStrings[this.connStringName].ConnectionString;
            var providerName = ConfigurationManager.ConnectionStrings[this.connStringName].ProviderName;
            var provider = DbProviderFactories.GetFactory(providerName);

            using (var conn = provider.CreateConnection())
            {
                if (conn != null)
                {
                    conn.ConnectionString = connString;
                    conn.Open();
                    using (var cmd = conn.CreateCommand())
                    {
                        var sqlQuery = string.Format("SELECT BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex FROM {0}BlogRollItems ", this.tablePrefix);
                        cmd.CommandText = sqlQuery;
                        cmd.CommandType = CommandType.Text;

                        using (var rdr = cmd.ExecuteReader())
                        {
                            if (rdr.HasRows)
                            {
                                while (rdr.Read())
                                {
                                    var br = new BlogRollItem
                                        {
                                            Id = rdr.GetGuid(0),
                                            Title = rdr.GetString(1),
                                            Description = rdr.IsDBNull(2) ? string.Empty : rdr.GetString(2),
                                            BlogUrl = rdr.IsDBNull(3) ? null : new Uri(rdr.GetString(3)),
                                            FeedUrl = rdr.IsDBNull(4) ? null : new Uri(rdr.GetString(4)),
                                            Xfn = rdr.IsDBNull(5) ? string.Empty : rdr.GetString(5),
                                            SortIndex = rdr.GetInt32(6)
                                        };

                                    blogRoll.Add(br);
                                    br.MarkOld();
                                }
                            }
                        }
                    }
                }
            }

            return blogRoll;
        }
开发者ID:karanbhasin,项目名称:blogEngine.Common,代码行数:54,代码来源:DbBlogProvider.cs


注:本文中的BlogRollItem.MarkOld方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。