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

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 gxxz_delfile : System.Web.UI.Page
  15. {
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         string str = this.Request["id3"];
  19.         string[] ids = str.Split(',');
  20.         foreach (string s in ids)
  21.         {
  22.             if (s == "")
  23.             {
  24.                 break;
  25.             }
  26.             else
  27.             {
  28.                 int id = Int32.Parse(s);
  29.                 files f = filesBLL.Select(id);
  30.                 string  where= "fre_f_id=" + f.f_id;
  31.                 IList<filerevert> flist = filerevertBLL.Select(where);
  32.                 
  33.                 if (flist.Count==0)
  34.                 {
  35.                     
  36.                     filesBLL.Delete(id);
  37.                 }
  38.                 else
  39.                 {
  40.                     filerevert ff = flist[0];
  41.                     filerevertBLL.Delete(ff.fre_id);
  42.                     filesBLL.Delete(id);
  43.                 }
  44.             }
  45.         }
  46.         this.Response.Write(string.Format(GetRedirect.WINALERT,"删除成功"));
  47.         this.Response.Write(string.Format(GetRedirect.REDIRECT,"lb_adminupload.aspx"));
  48.     }
  49. }