public void delete()
    {
        //删除信息
        //要删除的纪录的ID,保存在delList隐藏控件内
        string id = delList.Text;
        if (id != "")
        {
            data_conn cn = new data_conn();

            string body = "尊敬的用户:<br/>";
            body += "感谢您参与我们的论坛.<br/>";
            body += "由于您在发布的帖子违反本论坛协议而被管理员删除.敬请谅解详情请见<a herf=\"www.100allin.com\">www.100allin.com</a><br/>";
            body += "您在使用过程中,如有任何问题或建议,请随时联系傲赢网客户服务人员,我们将热忱为您服务。顺颂商祺!";
            DataSet dsBBS = cn.mdb_ds("select UserEmail from TB_User,TB_BBS where TB_User.Userid=TB_BBS.Userid and TB_BBS.id in (" + id + ")", "deleteBBSEmail");

            EmailSend email = new EmailSend();
            for (int i = 0; i <= dsBBS.Tables["deleteBBSEmail"].Rows.Count - 1; i++)
            {
                try
                {

                }
                catch (Exception e)
                {
                    email.send((string)dsBBS.Tables["deleteBBSEmail"].Rows[i]["UserEmail"].ToString(), body);
                }
            }

            DataSet ds = new DataSet();
            string sql = "";
            //sql = sql + "delete from TB_BBS where id in (" + id + ")";
            //cn.mdb_exe(sql);
            //sql = "delete from TB_Message where BBSID in (" + id + ")";
            //cn.mdb_exe(sql);
            sql = sql + "update TB_BBS set DeleSign=0 where id in (" + id + ")";
            cn.mdb_exe(sql);

            //string[] arrayId = id.Split(',');

            //for (int i = 0; i < arrayId.Length; i++)
            //{
            //    cn.mdb_exe("insert into TB_BBSAdminIncident (BBSID,AdminID,Meno,EditTime,Types) values (" + arrayId[i] + "," + Request.Cookies["bbsadmin_id"].Value + ",'" + this.txtMeno.Text + "',getDate(),3)");
            //}

            MessageBox("opsuccess", "恢复成功");

            //清空delList
            delList.Text = "";
        }
        else
        {
            //没有选择任何要删除的ID,弹出此对话框
            MessageBox("opfail", "未选择任何要恢复的项目");
        }
    }
예제 #2
0
    public void delete()
    {
        //删除信息
        //要删除的纪录的ID,保存在delList隐藏控件内
        string id = delList.Text;
        if (id!="")
        {
            data_conn cn = new data_conn();

            string body = "尊敬的用户:<br/>";
            body += "感谢您参与我们的论坛.<br/>";
            body += "由于您在发布的帖子违反本论坛协议而被管理员删除.敬请谅解详情请见<a herf=\"www.100allin.com\">www.100allin.com</a><br/>";
            body += "您在使用过程中,如有任何问题或建议,请随时联系傲赢网客户服务人员,我们将热忱为您服务。顺颂商祺!";
            DataSet dsBBS = cn.mdb_ds("select UserEmail from TB_User,TB_BBS where TB_User.Userid=TB_BBS.Userid and TB_BBS.id in (" + id + ")", "deleteBBSEmail");

            EmailSend email = new EmailSend();
            for (int i = 0; i <= dsBBS.Tables["deleteBBSEmail"].Rows.Count - 1; i++)
            {
        try
                {

                }
                catch (Exception e)
                {
                email.send((string)dsBBS.Tables["deleteBBSEmail"].Rows[i]["UserEmail"].ToString(), body);
        }
            }

            DataSet ds = new DataSet();
            string sql = "";
            sql = sql + "delete from TB_Question where id in (" + id + ")";
            cn.mdb_exe(sql);
            sql = "delete from TB_Question_Answer where QuestionID in (" + id + ")";
            cn.mdb_exe(sql);
            sql = "delete from TB_Question_supplement where QuestionID in (" + id + ")";
            cn.mdb_exe(sql);
            MessageBox("opsuccess", "删除成功");

            //清空delList
            delList.Text = "";
        }
        else
        {
            //没有选择任何要删除的ID,弹出此对话框
            MessageBox("opfail", "未选择任何要删除的项目");
        }
    }