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

.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 com.etong.DAL.FC;
  12. using com.etong.Inform;
  13. public partial class WorkFlow_WorkFlowWaitList : System.Web.UI.Page
  14. {
  15.     protected void Page_Load(object sender, EventArgs e)
  16.     {
  17.         if (!IsPostBack)
  18.         {
  19.             EtongFlyChouWF WFFly = new EtongFlyChouWF();
  20.             DataView dv = new DataView();
  21.             int iWait;
  22.             try
  23.             {
  24.                 iWait = Convert.ToInt32(Request.QueryString["StrWait"]);
  25.             }
  26.             catch
  27.             {
  28.                 iWait = 0;
  29.             }
  30.             if (iWait == 1) iWait = 1;
  31.             if (iWait == 2) iWait = -1;
  32.             int iUserID;
  33.             CheckUserInfo UInfo = new CheckUserInfo();
  34.             UInfo = (CheckUserInfo)Session["checkuserinfo"];
  35.             try
  36.             {
  37.                 iUserID = Convert.ToInt32(UInfo.UserID);
  38.             }
  39.             catch
  40.             {
  41.                 iUserID = -1;
  42.             }
  43.             int iEmpID;
  44.             try
  45.             {
  46.                 iEmpID = Convert.ToInt32(UInfo.EmpID);
  47.             }
  48.             catch
  49.             {
  50.                 iEmpID = -1;
  51.             }
  52.             EtongFlyChou EFly = new EtongFlyChou();
  53.             int iEmpType = EFly.GetEmpTypeEmp(iEmpID);
  54.             dv = WFFly.GetWFWaitData(iWait, iUserID, -1, 0, 2,iEmpType);
  55.             try
  56.             {
  57.                 this.GridView1.PageSize = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["MorePageNum"]);
  58.             }
  59.             catch
  60.             {
  61.                 this.GridView1.PageSize = 10;
  62.             }
  63.             this.GridView1.DataSource = dv;
  64.             this.GridView1.DataBind();
  65.         }
  66.     }
  67.     protected string FormatStr(object Objval)
  68.     {
  69.         string retval, strval;
  70.         strval = Convert.ToString(Objval);
  71.         if (strval == "1") retval = "已启用";
  72.         else if (strval == "0") retval = "已停用";
  73.         else retval = "未知状态";
  74.         return retval;
  75.     }
  76.     protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
  77.     {
  78.         int currentpageindex;
  79.         currentpageindex = Convert.ToInt32(e.NewPageIndex);
  80.         if (currentpageindex == -2)
  81.         {
  82.             TextBox txtNewPageIndex;
  83.             txtNewPageIndex = GridView1.BottomPagerRow.FindControl("LinkTextBoxNewPage") as TextBox;
  84.             if (txtNewPageIndex != null)
  85.             {
  86.                 try
  87.                 {
  88.                     currentpageindex = Convert.ToInt32(txtNewPageIndex.Text) - 1;
  89.                 }
  90.                 catch
  91.                 {
  92.                     currentpageindex = 0;
  93.                 }
  94.             }
  95.         }
  96.         currentpageindex = currentpageindex < 0 ? 0 : currentpageindex;
  97.         currentpageindex = currentpageindex >= GridView1.PageCount ? GridView1.PageCount - 1 : currentpageindex;
  98.         GridView1.PageIndex = currentpageindex;
  99.         EtongFlyChouWF WFFly = new EtongFlyChouWF();
  100.         DataView dv = new DataView();
  101.         int iWait;
  102.         try
  103.         {
  104.             iWait = Convert.ToInt32(Request.QueryString["StrWait"]);
  105.         }
  106.         catch
  107.         {
  108.             iWait = 0;
  109.         }
  110.         if (iWait == 1) iWait = 1;
  111.         if (iWait == 2) iWait = -1;
  112.         int iUserID;
  113.         CheckUserInfo UInfo = new CheckUserInfo();
  114.         UInfo = (CheckUserInfo)Session["checkuserinfo"];
  115.         try
  116.         {
  117.             iUserID = Convert.ToInt32(UInfo.UserID);
  118.         }
  119.         catch
  120.         {
  121.             iUserID = -1;
  122.         }
  123.         int iEmpID;
  124.         try
  125.         {
  126.             iEmpID = Convert.ToInt32(UInfo.EmpID);
  127.         }
  128.         catch
  129.         {
  130.             iEmpID = -1;
  131.         }
  132.         EtongFlyChou EFly = new EtongFlyChou();
  133.         int iEmpType = EFly.GetEmpTypeEmp(iEmpID);
  134.         dv = WFFly.GetWFWaitData(iWait, iUserID, 2, 0, 2,iEmpType);
  135.         GridView1.DataSource = dv;
  136.         GridView1.DataBind();
  137.     }
  138.     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  139.     {
  140.         if (e.Row.RowType == DataControlRowType.DataRow)
  141.         {
  142.             int iRow;
  143.             iRow = e.Row.DataItemIndex;
  144.             iRow = iRow % 2;
  145.             if (iRow > 0)
  146.                 e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='#f0f0f0';");
  147.             else
  148.                 e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';");
  149.             e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#E8F2FA';");
  150.             ((HyperLink)(e.Row.FindControl("HyperLink1"))).NavigateUrl = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "PageUrl")).Trim() + "?MustChooseItem=" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MustChooseItem")) + "&ActivityID=" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ActivityID")) + "&WFID=" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "WorkFlowID")) +
  151.                 "&WFInstanceID=" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "WFInstanceID")) + "&ActID=" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ActID"));
  152.         }
  153.     }
  154. }