WorkFlowWait.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:9k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using com.etong.DAL.FC;
- using com.etong.Inform;
- public partial class WorkFlow_WorkFlowWait : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- EtongFlyChouWF WFFly = new EtongFlyChouWF();
- DataView dv = new DataView();
- CheckUserInfo UInfo = new CheckUserInfo();
- UInfo = (CheckUserInfo)Session["checkuserinfo"];
- int iUserID;
- try
- {
- iUserID = Convert.ToInt32(UInfo.UserID);
- }
- catch
- {
- iUserID = -1;
- }
- int iEmpID;
- try
- {
- iEmpID = Convert.ToInt32(UInfo.EmpID);
- }
- catch
- {
- iEmpID = -1;
- }
- EtongFlyChou EFly = new EtongFlyChou();
- int iEmpType = EFly.GetEmpTypeEmp(iEmpID);
- dv = WFFly.GetWFWaitData(iUserID, iUserID, 2, 0, 2,iEmpType);//(iUserID, 1);
- int PageNums;
- try
- {
- PageNums = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["PageNum"]);
- }
- catch
- {
- PageNums = 5;
- }
- this.GridView1.PageSize = PageNums;
- this.GridView1.DataSource = dv;
- this.GridView1.DataBind();
- dv = WFFly.GetWFWaitData(-1, iUserID, -1, 0, 2,iEmpType);
- this.GridView2.PageSize = PageNums;
- this.GridView2.DataSource = dv;
- this.GridView2.DataBind();
- }
- }
- protected string FormatStr(object Objval)
- {
- string retval, strval;
- strval = Convert.ToString(Objval);
- if (strval == "1") retval = "已启用";
- else if (strval == "0") retval = "已停用";
- else retval = "未知状态";
- return retval;
- }
- protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
- {
- int currentpageindex;
- currentpageindex = Convert.ToInt32(e.NewPageIndex);
- if (currentpageindex == -2)
- {
- TextBox txtNewPageIndex;
- txtNewPageIndex = GridView1.BottomPagerRow.FindControl("LinkTextBoxNewPage") as TextBox;
- if (txtNewPageIndex != null)
- {
- try
- {
- currentpageindex = Convert.ToInt32(txtNewPageIndex.Text) - 1;
- }
- catch
- {
- currentpageindex = 0;
- }
- }
- }
- currentpageindex = currentpageindex < 0 ? 0 : currentpageindex;
- currentpageindex = currentpageindex >= GridView1.PageCount ? GridView1.PageCount - 1 : currentpageindex;
- GridView1.PageIndex = currentpageindex;
- EtongFlyChouWF WFFly = new EtongFlyChouWF();
- DataView dv = new DataView();
- CheckUserInfo UInfo = new CheckUserInfo();
- UInfo = (CheckUserInfo)Session["checkuserinfo"];
- int iUserID;
- try
- {
- iUserID = Convert.ToInt32(UInfo.UserID);
- }
- catch
- {
- iUserID = -1;
- }
- int iEmpID;
- try
- {
- iEmpID = Convert.ToInt32(UInfo.EmpID);
- }
- catch
- {
- iEmpID = -1;
- }
- EtongFlyChou EFly = new EtongFlyChou();
- int iEmpType = EFly.GetEmpTypeEmp(iEmpID);
- dv = WFFly.GetWFWaitData(iUserID, iUserID, 2, 0, 2,iEmpType);
- GridView1.DataSource = dv;
- GridView1.DataBind();
- }
- protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e)
- {
- int currentpageindex;
- currentpageindex = Convert.ToInt32(e.NewPageIndex);
- if (currentpageindex == -2)
- {
- TextBox txtNewPageIndex;
- txtNewPageIndex = GridView2.BottomPagerRow.FindControl("LinkTextBoxNewPage") as TextBox;
- if (txtNewPageIndex != null)
- {
- try
- {
- currentpageindex = Convert.ToInt32(txtNewPageIndex.Text) - 1;
- }
- catch
- {
- currentpageindex = 0;
- }
- }
- }
- currentpageindex = currentpageindex < 0 ? 0 : currentpageindex;
- currentpageindex = currentpageindex >= GridView2.PageCount ? GridView2.PageCount - 1 : currentpageindex;
- GridView2.PageIndex = currentpageindex;
- EtongFlyChouWF WFFly = new EtongFlyChouWF();
- DataView dv = new DataView();
- CheckUserInfo UInfo = new CheckUserInfo();
- UInfo = (CheckUserInfo)Session["checkuserinfo"];
- int iUserID;
- try
- {
- iUserID = Convert.ToInt32(UInfo.UserID);
- }
- catch
- {
- iUserID = -1;
- }
- int iEmpID;
- try
- {
- iEmpID = Convert.ToInt32(UInfo.EmpID);
- }
- catch
- {
- iEmpID = -1;
- }
- EtongFlyChou EFly = new EtongFlyChou();
- int iEmpType = EFly.GetEmpTypeEmp(iEmpID);
- dv = WFFly.GetWFWaitData(-1, iUserID, 2, 0, 2,iEmpType);
- GridView2.DataSource = dv;
- GridView2.DataBind();
- }
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- int iRow;
- iRow = e.Row.DataItemIndex;
- iRow = iRow % 2;
- if (iRow > 0)
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='#f0f0f0';");
- else
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';");
- e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#E8F2FA';");
- ((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")) +
- "&WFInstanceID=" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "WFInstanceID")) + "&ActID=" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ActID"));
- }//NavigateUrl='WFTaskBrowse.aspx?AssID=<%# DataBinder.Eval(Container,"DataItem.AssID") %>'
- }
- protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- int iRow;
- iRow = e.Row.DataItemIndex;
- iRow = iRow % 2;
- if (iRow>0)
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='#f0f0f0';");
- else
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';");
- e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#E8F2FA';");
- ((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")) +
- "&WFInstanceID=" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "WFInstanceID")) + "&ActID=" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ActID"));
- }
- }
- //protected void Go_Click(object sender, EventArgs e)
- //{
- // int newPageIndex;
- // TextBox txtNewPageIndex;
- // txtNewPageIndex = GridView1.Page.TemplateControl.FindControl("LinkTextBoxNewPage") as TextBox;
- // if (txtNewPageIndex != null)
- // {
- // newPageIndex = Convert.ToInt32(txtNewPageIndex.Text);
- // int currentpageindex = newPageIndex;
- // currentpageindex = currentpageindex < 0 ? 0 : currentpageindex;
- // currentpageindex = currentpageindex >= GridView1.PageCount ? GridView1.PageCount - 1 : currentpageindex;
- // GridView1.PageIndex = currentpageindex;
- // EtongFlyChouWF WFFly = new EtongFlyChouWF();
- // DataView dv = new DataView();
- // dv = WFFly.ReadEmpData();
- // GridView1.DataSource = dv;
- // GridView1.DataBind();
- // }
- //}
-
- }