public void IsAjaxFunction()
        {
            string state = "0";
            string isAjax = this.GetRequest("isAjax").ToLower();

            if (isAjax == "true")
            {
                string action = this.GetRequest("action").ToString();
                string values = this.GetRequest("values").ToString();
                string nickName = this.GetRequest("nickName").ToString();
                string NewsId = this.GetRequest("NewsId").ToString();
                try
                {
                    switch (action)
                    {
                        case "add":
                            state = this.Db.GetState("insert into NewsComment(NewsId,NickName,Content,Ip) values(@NewsID,@NickName,@Content,@IP)", this.Db.MakeParameters("@NewsID", NewsId, "@NickName", nickName, "@Content", values, "@IP", Request.UserHostAddress.ToString())) ? ("1") : ("0");
                            break;
                        case "shanchu":
                            state = this.Db.GetState("delete from  Product where P_ID=@P_ID", new System.Data.SqlClient.SqlParameter("@P_ID", values)) ? ("1") : ("0");
                            break;
                        default:
                            break;
                    }
                }
                catch (Exception ex)
                {
                    state = ex.Message;
                }
                Response.Clear();
                Response.Write(state);
                Response.End();
            }
        }

posted on 2009-06-22 17:31 sanmao 阅读(72) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

常用链接

留言簿(5)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜