示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsHttpPost)
            {
                if (Request.Form["op"].Trim().ToString() == "add")
                {
                    code    = Request.Form["txtcode"].Trim().ToString();
                    name    = Request.Form["txtName"].Trim().ToString();
                    way     = Request.Form["txtWay"].Trim().ToString();
                    content = Request.Form["txtContent"].Trim().ToString();
                    if (code != Request.Cookies["CheckCode"].Value.ToString())
                    {
                        errostr = Request.Form["hint_9001"].ToString();
                    }
                    else
                    {
                        GuestBookModel g = new GuestBookModel();
                        g.F_Contacts = VerifyTool.DeleteAll(name);
                        g.F_Way      = VerifyTool.DeleteAll(way);
                        g.F_Content  = VerifyTool.DeleteAll(content);
                        g.F_IP       = WebTools.GetRealIP();
                        g.F_Lang     = lang;
                        int res = EispGuestBookBLL.AddGuestBook(g);

                        if (res > 0)
                        {
                            errostr = Request.Form["hint_1001"].ToString();
                        }
                    }
                    ((Label)Master.FindControl("ErroStr")).Text = errostr;
                }
            }
        }