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"); }
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"]); }