protected void BtnOk_Click(object sender, EventArgs e) { Business.themess themess = new Business.themess(); Business.themessData themessdata = new Business.themessData(); themessdata.userid = userid.Text; themessdata.messtime = messtime.Text; themessdata.messcon = messcon.Text; themessdata.ter = ter.Text; themessdata.replys = replys.Text; if (Request.QueryString["id"] != null) { themessdata.Id = Request.QueryString["id"]; themess.Modify(themessdata); } else { themess.Insert(themessdata); } Response.Redirect("themesstb.aspx"); themess = null; themessdata = null; }
protected void Button1_Click(object sender, EventArgs e) { if (userid.Value == "") { Response.Write("<script>alert('请填写你的学号姓名!')</script>"); } else { Business.themess themess = new Business.themess(); Business.themessData themessdata = new Business.themessData(); themessdata.userid = userid.Value; themessdata.messtime = DateTime.Now.ToString(); themessdata.messcon = TextBox1.Text; themessdata.ter = ""; themessdata.replys = ""; if (Request.QueryString["id"] != null) { themessdata.Id = Request.QueryString["id"]; themess.Modify(themessdata); } else { themess.Insert(themessdata); } Response.Redirect("themesstb.aspx"); themess = null; themessdata = null; } }
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { string Id = e.CommandName; Business.themess themess = new Business.themess(); themess.Delete(Id); Repeater1.DataSource = themess.Get(""); Repeater1.DataBind(); themess = null; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Business.themess themess = new Business.themess(); Repeater1.DataSource = themess.Get(""); Repeater1.DataBind(); themess = null; } }
protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text == "") { Response.Write("<script>alert('请填写你的回复!')</script>"); } else { Business.themess themess = new Business.themess(); themess.Update(Request.QueryString["id"], TextBox1.Text); Response.Redirect("terthemesstb.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if ((string)Session["UserId"] != null) { Business.themess themess = new Business.themess(); Repeater1.DataSource = themess.Get(string.Format(" and userid ='{0}'", (string)Session["UserId"])); Repeater1.DataBind(); themess = null; } else { Response.Redirect("login.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["id"] != null) { Business.themess themess = new Business.themess(); Business.themessData[] themessdata = themess.Select(Request.QueryString["id"]); userid.Text = themessdata[0].userid; messtime.Text = themessdata[0].messtime; messcon.Text = themessdata[0].messcon; ter.Text = themessdata[0].ter; replys.Text = themessdata[0].replys; themess = null; themessdata = null; } } }