lt_delelt.aspx.cs
上传用户:lishan0805
上传日期:2019-12-08
资源大小:12048k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using COM.OA.BLL;
  12. using COM.OA.Entity;
  13. using System.Collections.Generic;
  14. public partial class linminchao_bbs_lt_delelt : System.Web.UI.Page
  15. {
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         users loginuser = Session["loginuser"] as users;
  19.         if (loginuser == null)
  20.         {
  21.             this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../../login.aspx"));
  22.         }
  23.         else
  24.         {
  25.             int i = Int32.Parse(this.Request.QueryString["id"]);
  26.             String where = "br_bbs_id='{0}'";
  27.             where = string.Format(where, i);
  28.             IList<bbsrevert> brIlist = bbsrevertBLL.Select(where);
  29.             if (brIlist.Count != 0)
  30.             {
  31.                 IList<bbsrevert> brlist = bbsrevertBLL.Select(where);
  32.                 foreach (bbsrevert brr in brlist)
  33.                 {
  34.                     bbsrevertBLL.Delete(brr);
  35.                 }
  36.                 bbs bb = bbsBLL.Select(i);
  37.                 int iii = bbsBLL.Delete(bb);
  38.                 if (iii < 0)
  39.                 {
  40.                     this.Response.Write(string.Format(GetRedirect.WINALERT, "删除帖子成功!"));
  41.                     this.Response.Write(string.Format(GetRedirect.REDIRECT, "lt_lookbbs.aspx"));
  42.                 }
  43.                 else
  44.                 {
  45.                     this.Response.Write(string.Format(GetRedirect.WINALERT, "删除帖子失败!"));
  46.                 }
  47.             }
  48.             else
  49.             {
  50.                 int iii = bbsBLL.Delete(i);
  51.                 if (iii < 0)
  52.                 {
  53.                     this.Response.Write(string.Format(GetRedirect.WINALERT, "删除帖子成功!"));
  54.                     this.Response.Write(string.Format(GetRedirect.REDIRECT, "lt_lookbbs.aspx"));
  55.                 }
  56.                 else
  57.                 {
  58.                     this.Response.Write(string.Format(GetRedirect.WINALERT, "删除帖子失败!"));
  59.                 }
  60.             }
  61.         }
  62.     }
  63. }