Exemplo n.º 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);
    }
Exemplo n.º 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();
    }
Exemplo n.º 3
0
 partial void DeleteBBSInfo(BBSInfo instance);
Exemplo n.º 4
0
 partial void UpdateBBSInfo(BBSInfo instance);
Exemplo n.º 5
0
 partial void InsertBBSInfo(BBSInfo instance);
Exemplo n.º 6
0
 private void detach_BBSInfo(BBSInfo entity)
 {
     this.SendPropertyChanging();
     entity.BBSCategory = null;
 }
Exemplo n.º 7
0
 private void attach_BBSInfo(BBSInfo entity)
 {
     this.SendPropertyChanging();
     entity.BBSCategory = this;
 }