protected void BtnOk_Click(object sender, EventArgs e) { Business.bbs bbs = new Business.bbs(); Business.bbsData bbsdata = new Business.bbsData(); bbsdata.userid = userid.Text; bbsdata.thetime = thetime.Text; bbsdata.memos = memos.Text; if (Request.QueryString["id"] != null) { bbsdata.Id = Request.QueryString["id"]; bbs.Modify(bbsdata); } else { bbs.Insert(bbsdata); } Response.Redirect("bbstb.aspx"); bbs = null; bbsdata = null; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Business.bbs bbs = new Business.bbs(); Repeater1.DataSource = bbs.Get(""); Repeater1.DataBind(); bbs = null; } }
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { string Id = e.CommandName; Business.bbs bbs = new Business.bbs(); bbs.Delete(Id); Repeater1.DataSource = bbs.Get(""); Repeater1.DataBind(); bbs = null; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["id"] != null) { Business.bbs bbs = new Business.bbs(); Business.bbsData[] bbsdata = bbs.Select(string.Format(" and id ={0}", Request.QueryString["id"])); userid.Text = bbsdata[0].userid; thetime.Text = bbsdata[0].thetime; memos.Text = bbsdata[0].memos; bbs = null; bbsdata = null; } } }
protected void Button1_Click(object sender, EventArgs e) { if (Session["UserId"] != null) { Business.bbs bbs = new Business.bbs(); Business.bbsData bbsdata = new Business.bbsData(); bbsdata.userid = (string)Session["UserId"]; bbsdata.thetime = DateTime.Now.ToString(); bbsdata.memos = comment.Value.Trim(); bbs.Insert(bbsdata); comment.Value = ""; Repeater1.DataSource = bbs.Get(""); Repeater1.DataBind(); } else { Response.Redirect("login.aspx"); } }