當前位置: 首頁>>代碼示例>>C#>>正文


C# Data.BlogDataDataContext類代碼示例

本文整理匯總了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();
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:11,代碼來源:BWeblog_Group.cs

示例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 "";
     }
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:30,代碼來源:BWeblog_User.cs

示例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();
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:11,代碼來源:BWeblog_UserCss.cs

示例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;
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:11,代碼來源:BWeblog_UserRssLink.cs

示例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();
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:11,代碼來源:BWeblog_Theme.cs

示例6: GetAll

 public static IEnumerable<View_WeblogUserRecommend> GetAll()
 {
     BlogDataDataContext BD = new BlogDataDataContext();
     return BD.View_WeblogUserRecommends.OrderByDescending(p=>p.Recommend_Id);
 
 
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:7,代碼來源:BView_WeblogUserRecommend.cs

示例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);
 
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:7,代碼來源:BView_WeblogUserRecommend.cs

示例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();
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:7,代碼來源:BWeblog_Recommend.cs

示例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);

        }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:8,代碼來源:BView_WeblogUserXSJBXX.cs

示例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();
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:7,代碼來源:BWeblog_CssFile.cs

示例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);
        }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:15,代碼來源:BWeblog_User.cs

示例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;
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:8,代碼來源:BView_WeblogThemeCssFile.cs

示例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();
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:12,代碼來源:BWeblog_Theme.cs

示例14: Insert

        public static bool  Insert(Weblog_RecommendTheme WRT)
        {
            BlogDataDataContext BD = new BlogDataDataContext();
            BD.Weblog_RecommendThemes.InsertOnSubmit(WRT); 
            BD.SubmitChanges();
            return true;

        }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:8,代碼來源:BWeblog_RecommendTheme.cs

示例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();
 }
開發者ID:LittlePeng,項目名稱:ncuhome,代碼行數:8,代碼來源:BWeblog_Notice.cs


注:本文中的Ncuhome.Blog.Data.BlogDataDataContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。