本文整理汇总了C#中BlogRollItem类的典型用法代码示例。如果您正苦于以下问题:C# BlogRollItem类的具体用法?C# BlogRollItem怎么用?C# BlogRollItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlogRollItem类属于命名空间,在下文中一共展示了BlogRollItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DeleteBlogRollItem
/// <summary>
/// Deletes a BlogRoll from the database
/// </summary>
/// <param name="blogRoll">BlogRoll to be removed</param>
public override void DeleteBlogRollItem(BlogRollItem blogRollItem)
{
List<BlogRollItem> blogRolls = BlogRollItem.BlogRolls;
blogRolls.Remove(blogRollItem);
blogRolls.Add(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 = "DELETE FROM " + tablePrefix + "BlogRollItems " +
"WHERE BlogRollId = " + parmPrefix + "BlogRollId";
cmd.CommandText = sqlQuery;
cmd.CommandType = CommandType.Text;
DbParameter dpID = provider.CreateParameter();
dpID.ParameterName = parmPrefix + "BlogRollId";
dpID.Value = blogRollItem.Id.ToString();
cmd.Parameters.Add(dpID);
cmd.ExecuteNonQuery();
}
}
}
开发者ID:rajgit31,项目名称:RajBlog,代码行数:34,代码来源:DbBlogProvider.cs
示例2: InsertBlogRollItem
/// <summary>
/// Inserts a BlogRoll
/// </summary>
/// <param name="blogRollItem">
/// The blog Roll Item.
/// </param>
public override void InsertBlogRollItem(BlogRollItem blogRollItem)
{
var blogRolls = FillBlogRoll();
if(blogRolls == null)
{
blogRolls = new List<BlogRollItem>();
}
blogRolls.Add(blogRollItem);
WriteBlogRollFile(blogRolls);
}
开发者ID:guilhermesuzuki,项目名称:BlogEngine.NET,代码行数:17,代码来源:BlogRoll.cs
示例3: Add
/// <summary>
/// Add blogroll
/// </summary>
/// <param name="form">submitted form</param>
public void Add(NameValueCollection form)
{
if (!Security.IsAdministrator)
throw new UnauthorizedAccessException();
var br = new BlogRollItem();
br.Title = form["txtTitle"];
br.Description = form["txtDesc"];
br.BlogUrl = new Uri(form["txtWebsite"]);
br.FeedUrl = new Uri(form["txtUrl"]);
br.Xfn = GetXfn(form);
if (string.IsNullOrEmpty(br.Xfn))
br.Xfn = "contact";
Providers.BlogService.InsertBlogRoll(br);
}
开发者ID:CharlesZHENG,项目名称:BlogEngine.NET,代码行数:21,代码来源:BlogRollVM.cs
示例4: DeleteBlogRollItem
/// <summary>
/// Deletes a BlogRoll from the database
/// </summary>
/// <param name="blogRollItem">
/// The blog Roll Item.
/// </param>
public override void DeleteBlogRollItem(BlogRollItem blogRollItem)
{
var blogRolls = BlogRollItem.BlogRolls;
blogRolls.Remove(blogRollItem);
blogRolls.Add(blogRollItem);
using (var conn = this.CreateConnection())
{
if (conn.HasConnection)
{
var sqlQuery = string.Format("DELETE FROM {0}BlogRollItems WHERE BlogRollId = {1}BlogRollId", this.tablePrefix, this.parmPrefix);
using (var cmd = conn.CreateTextCommand(sqlQuery))
{
cmd.Parameters.Add(conn.CreateParameter(FormatParamName("BlogRollId"), blogRollItem.Id.ToString()));
cmd.ExecuteNonQuery();
}
}
}
}
开发者ID:RajneeshVerma,项目名称:blogengine.net-mvc,代码行数:27,代码来源:DbBlogProvider.cs
示例5: DeleteBlogRollItem
/// <summary>
/// Deletes a BlogRoll from the database
/// </summary>
/// <param name="blogRollItem">
/// The blog Roll Item.
/// </param>
public override void DeleteBlogRollItem(BlogRollItem blogRollItem)
{
var blogRolls = BlogRollItem.BlogRolls;
blogRolls.Remove(blogRollItem);
blogRolls.Add(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)
{
return;
}
conn.ConnectionString = connString;
conn.Open();
using (var cmd = conn.CreateCommand())
{
var sqlQuery = string.Format("DELETE FROM {0}BlogRollItems WHERE BlogRollId = {1}BlogRollId", this.tablePrefix, this.parmPrefix);
cmd.CommandText = sqlQuery;
cmd.CommandType = CommandType.Text;
var parameter = provider.CreateParameter();
if (parameter != null)
{
parameter.ParameterName = string.Format("{0}BlogRollId", this.parmPrefix);
parameter.Value = blogRollItem.Id.ToString();
cmd.Parameters.Add(parameter);
}
cmd.ExecuteNonQuery();
}
}
}
开发者ID:karanbhasin,项目名称:blogEngine.Common,代码行数:43,代码来源:DbBlogProvider.cs
示例6: UpdateBlogRollItem
/// <summary>
/// Updates a BlogRoll
/// </summary>
/// <param name="blogRollItem">
/// The blog Roll Item.
/// </param>
public override void UpdateBlogRollItem(BlogRollItem blogRollItem)
{
var blogRolls = BlogRollItem.BlogRolls;
blogRolls.Remove(blogRollItem);
blogRolls.Add(blogRollItem);
this.WriteBlogRollFile(blogRolls);
}
开发者ID:RajneeshVerma,项目名称:blogengine.net-mvc,代码行数:13,代码来源:BlogRoll.cs
示例7: DeleteBlogRoll
/// <summary>
/// Deletes the specified BlogRoll from the current provider.
/// </summary>
/// <param name="blogRoll">
/// The blog Roll.
/// </param>
public static void DeleteBlogRoll(BlogRollItem blogRoll)
{
Provider.DeleteBlogRollItem(blogRoll);
}
开发者ID:raul-aguirre-flexit,项目名称:Carnaval-Radio,代码行数:10,代码来源:BlogService.cs
示例8: UpdateBlogRoll
/// <summary>
/// Updates an exsiting BlogRoll.
/// </summary>
/// <param name="blogRoll">
/// The blog Roll.
/// </param>
public static void UpdateBlogRoll(BlogRollItem blogRoll)
{
Provider.UpdateBlogRollItem(blogRoll);
}
开发者ID:raul-aguirre-flexit,项目名称:Carnaval-Radio,代码行数:10,代码来源:BlogService.cs
示例9: InsertBlogRoll
/// <summary>
/// Persists a new BlogRoll in the current provider.
/// </summary>
/// <param name="blogRoll">
/// The blog Roll.
/// </param>
public static void InsertBlogRoll(BlogRollItem blogRoll)
{
Provider.InsertBlogRollItem(blogRoll);
}
开发者ID:raul-aguirre-flexit,项目名称:Carnaval-Radio,代码行数:10,代码来源:BlogService.cs
示例10: 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
示例11: addBlogRollParametersToCommand
private void addBlogRollParametersToCommand(BlogRollItem blogRollItem, DbProviderFactory provider, DbCommand cmd)
{
DbParameter dpID = provider.CreateParameter();
dpID.ParameterName = parmPrefix + "BlogRollId";
dpID.Value = blogRollItem.Id.ToString();
cmd.Parameters.Add(dpID);
DbParameter dpTitle = provider.CreateParameter();
dpTitle.ParameterName = parmPrefix + "Title";
dpTitle.Value = blogRollItem.Title;
cmd.Parameters.Add(dpTitle);
DbParameter dpDesc = provider.CreateParameter();
dpDesc.ParameterName = parmPrefix + "Description";
dpDesc.Value = blogRollItem.Description;
cmd.Parameters.Add(dpDesc);
DbParameter dpBlogUrl = provider.CreateParameter();
dpBlogUrl.ParameterName = "BlogUrl";
dpBlogUrl.Value = blogRollItem.BlogUrl != null ? (object)blogRollItem.BlogUrl.ToString() : DBNull.Value;
cmd.Parameters.Add(dpBlogUrl);
DbParameter dpFeedUrl = provider.CreateParameter();
dpFeedUrl.ParameterName = "FeedUrl";
dpFeedUrl.Value = blogRollItem.FeedUrl != null ? (object)blogRollItem.FeedUrl.ToString() : DBNull.Value;
cmd.Parameters.Add(dpFeedUrl);
DbParameter dpXfn = provider.CreateParameter();
dpXfn.ParameterName = "Xfn";
dpXfn.Value = blogRollItem.Xfn;
cmd.Parameters.Add(dpXfn);
DbParameter dpSortIndex = provider.CreateParameter();
dpSortIndex.ParameterName = "SortIndex";
dpSortIndex.Value = blogRollItem.SortIndex;
cmd.Parameters.Add(dpSortIndex);
}
开发者ID:rajgit31,项目名称:RajBlog,代码行数:37,代码来源:DbBlogProvider.cs
示例12: 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
示例13: SelectBlogRollItem
/// <summary>
/// Gets a BlogRoll based on a Guid.
/// </summary>
/// <param name="id">The BlogRoll's Guid.</param>
/// <returns>A matching BlogRoll</returns>
public override BlogRollItem SelectBlogRollItem(Guid id)
{
BlogRollItem blogRoll = BlogRollItem.BlogRolls.Find(br => br.Id == id);
if (blogRoll == null)
{
blogRoll = new BlogRollItem();
}
blogRoll.MarkOld();
return blogRoll;
}
开发者ID:rajgit31,项目名称:RajBlog,代码行数:15,代码来源:DbBlogProvider.cs
示例14: InsertBlogRollItem
/// <summary>
/// Inserts a BlogRoll
/// </summary>
/// <param name="blogRollItem">
/// The blog Roll Item.
/// </param>
public override void InsertBlogRollItem(BlogRollItem blogRollItem)
{
var blogRolls = BlogRollItem.BlogRolls;
blogRolls.Add(blogRollItem);
this.WriteBlogRollFile(blogRolls);
}
开发者ID:RajneeshVerma,项目名称:blogengine.net-mvc,代码行数:13,代码来源:BlogRoll.cs
示例15: UpdateBlogRollItem
/// <summary>
/// Saves an existing BlogRoll to the database
/// </summary>
/// <param name="blogRollItem">
/// BlogRoll to be saved
/// </param>
public override void UpdateBlogRollItem(BlogRollItem blogRollItem)
{
var blogRolls = BlogRollItem.BlogRolls;
blogRolls.Remove(blogRollItem);
blogRolls.Add(blogRollItem);
using (var conn = this.CreateConnection())
{
if (conn.HasConnection)
{
var sqlQuery = string.Format("UPDATE {0}BlogRollItems SET Title = {1}Title, Description = {1}Description, BlogUrl = {1}BlogUrl, FeedUrl = {1}FeedUrl, Xfn = {1}Xfn, SortIndex = {1}SortIndex WHERE BlogId = {1}BlogId AND BlogRollId = {1}BlogRollId", this.tablePrefix, this.parmPrefix);
using (var cmd = conn.CreateTextCommand(sqlQuery))
{
this.AddBlogRollParametersToCommand(blogRollItem, conn, cmd);
cmd.ExecuteNonQuery();
}
}
}
}
开发者ID:mukhtiarlander,项目名称:git_demo_torit,代码行数:26,代码来源:DbBlogProvider.cs
示例16: DeleteBlogRoll
/// <summary>
/// Deletes the specified BlogRoll from the current provider.
/// </summary>
/// <param name="blogRoll">
/// The blog Roll.
/// </param>
public static void DeleteBlogRoll(BlogRollItem blogRoll)
{
LoadProviders();
provider.DeleteBlogRollItem(blogRoll);
}
开发者ID:karanbhasin,项目名称:blogEngine.Common,代码行数:11,代码来源:BlogService.cs
示例17: UpdateBlogRoll
/// <summary>
/// Updates an exsiting BlogRoll.
/// </summary>
/// <param name="blogRoll">
/// The blog Roll.
/// </param>
public static void UpdateBlogRoll(BlogRollItem blogRoll)
{
LoadProviders();
provider.UpdateBlogRollItem(blogRoll);
}
开发者ID:karanbhasin,项目名称:blogEngine.Common,代码行数:11,代码来源:BlogService.cs
示例18: InsertBlogRoll
/// <summary>
/// Persists a new BlogRoll in the current provider.
/// </summary>
/// <param name="blogRoll">
/// The blog Roll.
/// </param>
public static void InsertBlogRoll(BlogRollItem blogRoll)
{
LoadProviders();
provider.InsertBlogRollItem(blogRoll);
}
开发者ID:karanbhasin,项目名称:blogEngine.Common,代码行数:11,代码来源:BlogService.cs
示例19: Process_DoFolderUpdate
private void Process_DoFolderUpdate()
{
bool bInheritanceIsDif;
bInheritanceIsDif = false;
int isub = 0;
string init_xmlconfig = Request.Form["init_xmlconfig"];
string init_frm_xmlinheritance = Request.Form["init_frm_xmlinheritance"];
Ektron.Cms.Content.EkXmlIndexing XmlInd;
FolderData folder_data = null;
Ektron.Cms.Content.EkContent m_refContent;
SubscriptionPropertiesData sub_prop_data = new SubscriptionPropertiesData();
Collection page_subscription_data = new Collection();
Collection page_sub_temp = new Collection();
Array arrSubscriptions;
int i = 0;
BlogRollItem[] abriRoll;
string sCatTemp = "";
List<string> siteAliasList = new List<string>();
string[] arSiteAliasList;
Ektron.Cms.SiteAliasApi _refSiteAliasApi;
bool subscriptionRestore = false;
m_refContent = _ContentApi.EkContentRef;
if (_FolderId == -1)
{
_FolderId = _Id; //i.e Request.Form(folder_id.UniqueID)
}
_FolderData = _ContentApi.GetFolderById(_Id, true, true);
_FolderType = _FolderData.FolderType;
if (Convert.ToString(_FolderId) != "")
{
if (_FolderType != (int)Ektron.Cms.Common.EkEnumeration.FolderType.Catalog)
{
if (!string.IsNullOrEmpty(Request.Form["web_alert_inherit_checkbox"]))
{
sub_prop_data.BreakInheritance = false;
subscriptionRestore = true;
}
else
{
sub_prop_data.BreakInheritance = true;
if (!string.IsNullOrEmpty(Request.Form["web_alert_restore_inherit_checkbox"]))
{
subscriptionRestore = true;
}
}
if (Request.Form["notify_option"] == ("Always"))
{
sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Always;
}
else if (Request.Form["notify_option"] == ("Initial"))
{
sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Initial;
}
else if (Request.Form["notify_option"] == ("Never"))
{
sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Never;
}
sub_prop_data.SuspendNextNotification = false;
sub_prop_data.SendNextNotification = false;
sub_prop_data.OptOutID = Convert.ToInt64(Request.Form["notify_optoutid"]);
if (!string.IsNullOrEmpty((Request.Form["use_message_button"])))
{
sub_prop_data.DefaultMessageID = Convert.ToInt64(Request.Form["notify_messageid"]);
}
else
{
sub_prop_data.DefaultMessageID = 0;
}
if (!string.IsNullOrEmpty(Request.Form["use_summary_button"]))
{
sub_prop_data.SummaryID = 1;
}
else
{
sub_prop_data.SummaryID = 0;
}
if (!string.IsNullOrEmpty(Request.Form["use_content_button"]))
{
sub_prop_data.ContentID = Convert.ToInt64(Request.Form["frm_content_id"]);
}
else
{
sub_prop_data.ContentID = 0;
}
sub_prop_data.UnsubscribeID = Convert.ToInt64(Request.Form["notify_unsubscribeid"]);
if (!string.IsNullOrEmpty(Request.Form["notify_url"]))
{
sub_prop_data.URL = Request.Form["notify_url"];
}
else
{
sub_prop_data.URL = Request.ServerVariables["HTTP_HOST"];
//.........这里部分代码省略.........
开发者ID:jaytem,项目名称:minGit,代码行数:101,代码来源:editfolderattributes.ascx.cs
示例20: InsertBlogRollItem
/// <summary>
/// Adds a new BlogRoll to the database.
/// </summary>
/// <param name="blogRollItem">
/// The blog Roll Item.
/// </param>
public override void InsertBlogRollItem(BlogRollItem blogRollItem)
{
var blogRolls = BlogRollItem.BlogRolls;
blogRolls.Add(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)
{
return;
}
conn.ConnectionString = connString;
conn.Open();
using (var cmd = conn.CreateCommand())
{
var sqlQuery = string.Format("INSERT INTO {0}BlogRollItems (BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex) VALUES (@BlogRollId, @Title, @Description, @BlogUrl, @FeedUrl, @Xfn, @SortIndex)", this.tablePrefix);
if (this.parmPrefix != "@")
{
sqlQuery = sqlQuery.Replace("@", this.parmPrefix);
}
cmd.CommandText = sqlQuery;
cmd.CommandType = CommandType.Text;
this.AddBlogRollParametersToCommand(blogRollItem, provider, cmd);
cmd.ExecuteNonQuery();
}
}
}
开发者ID:karanbhasin,项目名称:blogEngine.Common,代码行数:41,代码来源:DbBlogProvider.cs
注:本文中的BlogRollItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论