Exemple #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            BBSDataContext lq   = new BBSDataContext();
            BBSNote        note = new BBSNote();

            note.bnSubject = txtbnSubject.Text;
            note.bnContent = txtbnContent.Text;
            note.uID       = Convert.ToInt32(Session["uID"]);
            note.bnAddTime = System.DateTime.Now;
            lq.BBSNote.InsertOnSubmit(note);
            lq.SubmitChanges();
            Response.Redirect("BBSNoteList.aspx");
        }
Exemple #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            BBSDataContext lq = new BBSDataContext();
            BBSAnswer      ba = new BBSAnswer();

            ba.uID       = Convert.ToInt32(Session["uID"]);
            ba.bnID      = Convert.ToInt32(Request["id"]);
            ba.baContent = txtbaContent.Text;
            ba.baAddTime = System.DateTime.Now;
            lq.BBSAnswer.InsertOnSubmit(ba);
            lq.SubmitChanges();
            Response.Redirect("BBSAnswerList.aspx?id=" + Request["id"]);
        }