主要实现功能是网站后台管理员审核用户注册的信息(网站用VS2008和SQL2005 C#语言做)
 
会员表:
T_Club(ClubID(主键),Name,Password,E_mail,Sex(bit型,1男、0女),BornDate,Academy,Special,Phone,IsPass(审核状态,1已审核、0未审核))
 我用GridView控件把数据库里的数据显示在网页里,已在GridView控件编辑列里添加CommandFiled里的“选择”按钮,把它的SelectText改为“通过/取消”,想要用它来实现改变审核状态这个功能,比如点击“通过/取消”之前审核状态是“未审核”,点击之后为“审核”!现已把数据显示出来了,就是没有实现上述这个功能,求高手帮写实现上述功能的完整代码!鞠躬感谢!!!
在线等答案!!!!

解决方案 »

  1.   

    给你个思路吧,你可以定义“选择”按钮的改变事件,当改变为“通过/取消”,的时候就相对的修改数据库IsPass的值,改变后再绑定下列表就行啦。
      

  2.   

     <ItemTemplate>
                                                                    <asp:LinkButton ID="LinkButton3" runat="server" CommandArgument='<%# Eval("Id") %>'
                                                                        CommandName="auditing" Style="position: relative"><%#GetIsPassAuditing()%></asp:LinkButton>
                                                                </ItemTemplate>
     /// <summary>
        /// 返回是否通过审核的字符
        /// </summary>
        /// <returns></returns>
        protected string GetIsPassAuditing()
        {        int isPassId = Convert.ToInt32(Eval("IsPass"));
            if (isPassId == 0)
            {
                return "未审核";
                
            }
            else
            {
                return "审核";
            }
        }
     protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "auditing")
            {
                string id = e.CommandArgument.ToString();
                Comment comm = CommentManager.GetCommentByid(Convert.ToInt32( id));
                if (comm.IsPass == 0)
                {
                    comm.IsPass = 1;
                }
                else
                {
                    comm.IsPass = 0;
                }
                    if (CommentManager.ModifyCommentByid(comm) > 0)
                    {
                        Server.Transfer("CommentManager.aspx");
                    }
            }
            
        }
      

  3.   

    你在看看吧。。 gridview 也用得少 这个我曾经做过的,没得问题的。。模板列。向<ItemTemplate>你放一个 LinkButton 设置
    CommandArgument    CommandName  再就是后台的一个更新操作了。。出的是什么问题呀
      

  4.   

    3个错误
    1,找不到类型活命名空间名称"Comment"
    2、当前上下文中不存在名称"CommentManager"
    3、当前上下文中不存在名称"CommentManager"