Exemple #1
0
    public bool UpdateMsg(int infoid)
    {
        //建立資料內文物件
        DataClassesDataContext db = new DataClassesDataContext();
        //抓取符合條件的記錄
        BBSInfo info = db.BBSInfo.First(p => p.InfoID == infoid);

        //回覆數加1
        info.ReplyCount += 1;
        //修改回覆日期
        info.LastReplytime = DateTime.Now.Date;
        //提交更改
        db.SubmitChanges();
        return(true);
    }
Exemple #2
0
    public void AddMsg(string title, string user, int categoryid)
    {
        //建立資料內文物件
        DataClassesDataContext db = new DataClassesDataContext();
        //建立新的論壇物件
        BBSInfo myinfo = new BBSInfo
        {
            Title         = title,
            FileName      = getFilename().ToString(),
            PostTime      = DateTime.Now.Date,
            ReplyCount    = 0,
            LastReplytime = DateTime.Now.Date,
            PostUser      = user,
            CategoryID    = categoryid
        };

        xmlfilename = myinfo.FileName;
        //添加論壇物件到資料內文
        db.BBSInfo.InsertOnSubmit((myinfo));
        //提交易動
        db.SubmitChanges();
    }
Exemple #3
0
 partial void DeleteBBSInfo(BBSInfo instance);
Exemple #4
0
 partial void UpdateBBSInfo(BBSInfo instance);
Exemple #5
0
 partial void InsertBBSInfo(BBSInfo instance);
Exemple #6
0
 private void detach_BBSInfo(BBSInfo entity)
 {
     this.SendPropertyChanging();
     entity.BBSCategory = null;
 }
Exemple #7
0
 private void attach_BBSInfo(BBSInfo entity)
 {
     this.SendPropertyChanging();
     entity.BBSCategory = this;
 }