本文整理汇总了C#中Ncuhome.Blog.Data.BlogDataDataContext.SubmitChanges方法的典型用法代码示例。如果您正苦于以下问题:C# BlogDataDataContext.SubmitChanges方法的具体用法?C# BlogDataDataContext.SubmitChanges怎么用?C# BlogDataDataContext.SubmitChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ncuhome.Blog.Data.BlogDataDataContext
的用法示例。
在下文中一共展示了BlogDataDataContext.SubmitChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
/// <summary>
/// 删除记录
/// </summary>
/// <param name="GroupId"></param>
public static void Delete(int GroupId)
{
BlogDataDataContext BD = new BlogDataDataContext();
var temp = BD.Weblog_Groups.Single(p => p.Group_Id == GroupId);
BD.Weblog_Groups.DeleteOnSubmit(temp);
BD.SubmitChanges();
}
示例2: Edit
public static void Edit(Weblog_Recommend WR)
{
BlogDataDataContext BD = new BlogDataDataContext();
var temp= BD.Weblog_Recommends.Single(p=>p.Recommend_Id==WR.Recommend_Id);
temp.Recommend_LogId = WR.Recommend_LogId;
BD.SubmitChanges();
}
示例3: InsertRssLink
/// <summary>
/// 插入新的RssLink
/// </summary>
/// <param name="WURL"></param>
public static bool InsertRssLink(Weblog_UserRssLink WURL)
{
BlogDataDataContext BD = new BlogDataDataContext();
BD.Weblog_UserRssLinks.InsertOnSubmit(WURL);
BD.SubmitChanges();
return true;
}
示例4: DeleteById
public static void DeleteById(int Id)
{
BlogDataDataContext BD = new BlogDataDataContext();
var temp = BD.Weblog_CssFiles.Where(p => p.CssFile_Id == Id);
BD.Weblog_CssFiles.DeleteAllOnSubmit(temp);
BD.SubmitChanges();
}
示例5: Delete
/// <summary>
/// 删除主题
/// </summary>
/// <param name="Id"></param>
public static void Delete(int Id)
{
BlogDataDataContext BD = new BlogDataDataContext();
var temp = BD.Weblog_Themes.Single(p => p.Theme_Id == Id);
BD.Weblog_Themes.DeleteOnSubmit(temp);
BD.SubmitChanges();
}
示例6: Delete
/// <summary>
/// 删除记录
/// </summary>
/// <param name="CssId"></param>
public static void Delete(int CssId)
{
BlogDataDataContext BD = new BlogDataDataContext();
var temp = BD.Weblog_UserCsses.Single(p => p.UserCss_Id == CssId);
BD.Weblog_UserCsses.DeleteOnSubmit(temp);
BD.SubmitChanges();
}
示例7: Edit
public static void Edit(Weblog_Notice WN)
{
BlogDataDataContext BD = new BlogDataDataContext();
Weblog_Notice notice = BD.Weblog_Notices.Where(p => p.Notice_Type == 1).First();
notice.Notice_Content = System.Web.HttpContext.Current.Server.HtmlEncode(WN.Notice_Content).Replace("\n", "<br />");
notice.Notice_CreateTime = DateTime.Now;
BD.SubmitChanges();
}
示例8: Update
/// <summary>
/// 修改主题
/// </summary>
/// <param name="WT"></param>
public static void Update(Weblog_Theme WT)
{
BlogDataDataContext BD = new BlogDataDataContext();
var temp = BD.Weblog_Themes.Single(p => p.Theme_Id == WT.Theme_Id);
temp.Theme_Intro = WT.Theme_Intro;
temp.Theme_Name = WT.Theme_Name;
BD.SubmitChanges();
}
示例9: Insert
public static bool Insert(Weblog_RecommendTheme WRT)
{
BlogDataDataContext BD = new BlogDataDataContext();
BD.Weblog_RecommendThemes.InsertOnSubmit(WRT);
BD.SubmitChanges();
return true;
}
示例10: Update
/// <summary>
/// 更新记录
/// </summary>
/// <param name="WUC"></param>
public static void Update(Weblog_UserCss WUC)
{
BlogDataDataContext BD = new BlogDataDataContext();
var temp = BD.Weblog_UserCsses.Single(p => p.UserCss_Id == WUC.UserCss_Id);
temp.UserCss_CssFileId = WUC.UserCss_CssFileId;
temp.UserCss_Used = WUC.UserCss_Used;
temp.UserCss_UserId = WUC.UserCss_UserId;
BD.SubmitChanges();
}
示例11: DeleteRssLinkByID
/// <summary>
/// 根据ID来删除RssLink
/// </summary>
/// <param name="ID"></param>
/// <returns></returns>
public static bool DeleteRssLinkByID(int UID,int ID)
{
BlogDataDataContext BD = new BlogDataDataContext();
Weblog_UserRssLink temp = null;
var WURL = BD.Weblog_UserRssLinks.Where(p => p.Weblog_UserRssLinkId == ID&&p.Weblog_UserId==UID);
if (WURL.Count()>0)
{
temp = WURL.First();
BD.Weblog_UserRssLinks.DeleteOnSubmit(temp);
BD.SubmitChanges();
return true;
}
return false;
}
示例12: Insert
/// <summary>
/// 插入新的文章种类
/// </summary>
/// <param name="WC"></param>
/// <returns></returns>
public static bool Insert(Weblog_Category WC)
{
BlogDataDataContext BD = new BlogDataDataContext();
try
{
BD.Weblog_Categorys.InsertOnSubmit(WC);
BD.SubmitChanges();
}
catch (Exception)
{
return false;
}
return true;
}
示例13: Update
/// <summary>
/// 修改数据
/// </summary>
/// <param name="WG"></param>
public static void Update(Weblog_Group WG)
{
BlogDataDataContext BD = new BlogDataDataContext();
var temp = BD.Weblog_Groups.Single(p=>p.Group_Id==WG.Group_Id);
temp.Group_AdministratorsCount = WG.Group_AdministratorsCount;
temp.Group_ClassId = WG.Group_ClassId;
temp.Group_Competence = WG.Group_Competence;
temp.Group_CreateTime = WG.Group_CreateTime;
temp.Group_FounderId = WG.Group_FounderId;
temp.Group_ImageUrl = WG.Group_ImageUrl;
temp.Group_Introduce = WG.Group_Introduce;
temp.Group_IsCertificateWhileJoin = WG.Group_IsCertificateWhileJoin;
temp.Group_IsViewByStrangers = WG.Group_IsViewByStrangers;
temp.Group_Keywords = WG.Group_Keywords;
temp.Group_MembersCount = WG.Group_MembersCount;
temp.Group_Name = WG.Group_Name;
temp.Group_Notice = WG.Group_Notice;
temp.Group_TopicCount = WG.Group_TopicCount;
temp.Group_Url = WG.Group_Url;
BD.SubmitChanges();
}
示例14: UpdateRssLinkByID
/// <summary>
/// 更新RSS镜像是否审核通过
/// </summary>
/// <param name="ID">RssLinkID</param>
/// <returns></returns>
public static bool UpdateRssLinkByID(int ID)
{
BlogDataDataContext BD = new BlogDataDataContext();
Weblog_UserRssLink temp = null;
var WURL = BD.Weblog_UserRssLinks.Where(p => p.Weblog_UserRssLinkId == ID);
if (WURL.Count()>0)
{
temp = WURL.First();
if (temp.Weblog_UserRssIsPassed==true)
{
temp.Weblog_UserRssIsPassed = false;
}
else
{
temp.Weblog_UserRssIsPassed = true;
}
BD.SubmitChanges();
return true;
}
return false;
}
示例15: Update
public static void Update(Weblog_Log WL)
{
BlogDataDataContext BD = new BlogDataDataContext();
Weblog_Log temp = BD.Weblog_Logs.Single(p => p.Log_Id == WL.Log_Id);
temp.Log_CateId = WL.Log_CateId;
temp.Log_Title = WL.Log_Title;
temp.Log_Content = WL.Log_Content;
temp.Log_IsDraft = WL.Log_IsDraft;
temp.Log_LastModiTime = WL.Log_LastModiTime;
temp.Log_IsTop = WL.Log_IsTop;
temp.Log_IsPasssword = WL.Log_IsPasssword;
temp.Log_IsEnRePly = WL.Log_IsEnRePly;
temp.Log_IsIndexShow = WL.Log_IsIndexShow;
temp.Log_PassWord = WL.Log_PassWord;
temp.Log_KeyWords = WL.Log_KeyWords;
temp.Log_CreateTime = WL.Log_CreateTime;
BD.SubmitChanges();
}