예제 #1
0
        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;
            }
        }
예제 #2
0
        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;
        }