WorkFlowSelectDoc.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:3k
源码类别:

.net编程

开发平台:

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 System.IO;
  12. using System.Text;
  13. using com.etong.DAL.FC;
  14. public partial class Workflow_WorkFlowSelectDoc : System.Web.UI.Page
  15. {
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         if (!IsPostBack)
  19.         {
  20.             string FDir = "c://";
  21.             //ArrayList FList = new ArrayList();
  22.             FDir = Server.MapPath(Request.ServerVariables["PATH_INFO"]);
  23.             FDir = FDir.Substring(0, FDir.Length - (FDir.Split('\').GetValue(FDir.Split('\').Length - 1)).ToString().Length);
  24.             FDir = FDir + "Doc";
  25.             string[] FList;
  26.             string FDirName;
  27.             int starti = 0;
  28.             if (Directory.Exists(FDir) == true)
  29.             {
  30.                 FList = Directory.GetFiles(FDir);
  31.                 for (Int16 i = 0; i < FList.Length; i++)
  32.                 {
  33.                     ListItem lst = new ListItem();
  34.                     FDirName = FList.GetValue(i).ToString();
  35.                     starti =FDirName.Length - (FDirName.Split('\').GetValue(FDirName.Split('\').Length - 1)).ToString().Length;
  36.                     lst.Text = FDirName.Substring(starti,FDirName.Length-starti);
  37.                     lst.Value = FDirName;
  38.                     lbDoc.Items.Add(lst);
  39.                 }
  40.             }
  41.             try
  42.             {
  43.                 int strM = Convert.ToInt32(Request.QueryString["StrM"]);
  44.                 if (strM > -1)
  45.                 {
  46.                     EtongFlyChouWF EFlyWF = new EtongFlyChouWF();
  47.                     DataView dv = new DataView();
  48.                     dv = EFlyWF.GetActFName(strM);
  49.                     starti = 0;
  50.                     string sDoc;
  51.                     for (int k = 0; k < dv.Table.Rows.Count; k++)
  52.                     {
  53.                         ListItem lstk = new ListItem();
  54.                         sDoc = dv.Table.Rows[k][0].ToString();
  55.                         starti = sDoc.Length - (sDoc.Split('\').GetValue(sDoc.Split('\').Length - 1)).ToString().Length;
  56.                         lstk.Text = sDoc.Substring(starti, sDoc.Length - starti);
  57.                         lstk.Value = sDoc;
  58.                         LstDoc.Items.Add(lstk);
  59.                     }
  60.                 }
  61.             }
  62.             catch
  63.             {
  64.             }
  65.         }
  66.     }
  67.     protected void ImgOK_Click(object sender, ImageClickEventArgs e)
  68.     {
  69.         string RetSelectValue = "";
  70.         RetSelectValue = HSelectedValue.Value + "|" + HSelectedText.Value;
  71.         this.ClientScript.RegisterStartupScript(this.GetType(), "", "window.returnValue='" + RetSelectValue + "';window.close();", true);
  72.     }
  73. }