本文整理汇总了C#中Ncuhome.Blog.Data.BlogDataDataContext类的典型用法代码示例。如果您正苦于以下问题:C# BlogDataDataContext类的具体用法?C# BlogDataDataContext怎么用?C# BlogDataDataContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlogDataDataContext类属于Ncuhome.Blog.Data命名空间,在下文中一共展示了BlogDataDataContext类的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: GetUserDomainByLogID
/// <summary>
/// 根据logid来获取用户域名
/// </summary>
/// <param name="logId">日记ID</param>
/// <returns></returns>
public static string GetUserDomainByLogID(int logId)
{
BlogDataDataContext BD = new BlogDataDataContext();
//string domain = "";
//int userId = -1;
Weblog_Log temp = null;
var WL = BD.Weblog_Logs.Where(p => p.Log_Id == logId);
if (WL.Count() > 0)
{
temp = WL.First();
var WU = BD.Weblog_Users.Where(p => p.User_Id == temp.Log_UserId);
if (WU.Count() > 0)
{
return WU.First().User_DomainName;
}
else
{
return "";
}
}
else
{
return "";
}
}
示例3: 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();
}
示例4: 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;
}
示例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: GetAll
public static IEnumerable<View_WeblogUserRecommend> GetAll()
{
BlogDataDataContext BD = new BlogDataDataContext();
return BD.View_WeblogUserRecommends.OrderByDescending(p=>p.Recommend_Id);
}
示例7: GetByPageIndex
public static IEnumerable<View_WeblogUserRecommend> GetByPageIndex(Int32 PageIndex,Int32 Length)
{
BlogDataDataContext BD = new BlogDataDataContext();
return BD.View_WeblogUserRecommends.Where(p=>p.Recommend_ThemeId==PageIndex).OrderByDescending(p=>p.Recommend_CreateTime);
}
示例8: 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();
}
示例9: SearchByXH
//通过学号选
public static IEnumerable<View_WeblogUserXSJBXX> SearchByXH(string XH)
{
BlogDataDataContext BD = new BlogDataDataContext();
//return BD.View_WeblogUserXSJBXXes.Single(p=>p.XH==XH);
return BD.View_WeblogUserXSJBXXes.Where(p => p.XH == XH);
}
示例10: 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();
}
示例11: GetAllPaged
/// <summary>
/// myself:要利用Linq2Sql的延迟
/// </summary>
/// <param name="PageIndex"></param>
/// <param name="Length"></param>
/// <param name="Count"></param>
/// <returns></returns>
public static IEnumerable<Weblog_User> GetAllPaged(int PageIndex, int Length, out int Count)
{
BlogDataDataContext BD = new BlogDataDataContext();
var users = BD.Weblog_Users.Select(p => p).Where(p => p.User_TxzId < 200000).OrderByDescending(p => p.CreateTime);
Count = users.Count();
return users.Skip((PageIndex - 1) * Length).Take(Length);
}
示例12: CheckExist
public static bool CheckExist(int Id)
{
BlogDataDataContext BD = new BlogDataDataContext();
if (BD.Weblog_CssFiles.Where(p => p.CssFile_Id == Id).Count() == 1)
return true;
else
return false;
}
示例13: 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();
}
示例14: Insert
public static bool Insert(Weblog_RecommendTheme WRT)
{
BlogDataDataContext BD = new BlogDataDataContext();
BD.Weblog_RecommendThemes.InsertOnSubmit(WRT);
BD.SubmitChanges();
return true;
}
示例15: 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();
}