OverWorkList.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:3k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections.Generic;
  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. public partial class Work_OverWorkList : System.Web.UI.Page
  12. {
  13.     /// <summary>
  14.     /// 模板 
  15.     /// </summary>
  16.     Model.FlowRunMark MR = new Model.FlowRunMark();
  17.     /// <summary>
  18.     /// 业务
  19.     /// </summary>
  20.     BLL.FlowRunMark BR = new BLL.FlowRunMark();
  21.     /// <summary>
  22.     /// 查询条件
  23.     /// </summary>
  24.     public string TiaoJian
  25.     {
  26.         get
  27.         {
  28.             if (ViewState["Work_WorkListTiaoJian"] == null)
  29.             {
  30.                 return "";
  31.             }
  32.             else
  33.             {
  34.                 return ViewState["Work_WorkListTiaoJian"].ToString();
  35.             }
  36.         }
  37.         set { ViewState["Work_WorkListTiaoJian"] = value; }
  38.     }
  39.     protected void Page_Load(object sender, EventArgs e)
  40.     {
  41.         LoginLogic.MatchLoad("../", "Work_WorkList");
  42.         if (!IsPostBack)
  43.         {
  44.             MyDataBind(1);
  45.         }
  46.     }
  47.     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  48.     {
  49.         for (int i = 0; i < GridView1.Rows.Count; i++)
  50.         {
  51.             //首先判断是否是数据行
  52.             if (e.Row.RowType == DataControlRowType.DataRow)
  53.             {
  54.                 //当鼠标停留时更改背景色
  55.                 e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#F0F0F0'");
  56.                 //当鼠标移开时还原背景色
  57.                 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
  58.             }
  59.         }
  60.     }
  61.     protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
  62.     {
  63.         MyDataBind(e.NewPageIndex);
  64.     }
  65.     /// <summary>
  66.     /// 获取信息
  67.     /// </summary>
  68.     /// <param name="pidx">页号</param>
  69.     public void MyDataBind(int pidx)
  70.     {
  71.         TiaoJian = " QSYJR='" + SessionInclude.SessionId + "'";
  72.         AspNetPager1.RecordCount = BR.GetCount(TiaoJian);
  73.         List<Model.FlowRunMark> LRData = BR.GetPageList(20, pidx, "ID", false, TiaoJian);
  74.         if (LRData.Count == 0)
  75.         {
  76.             Model.FlowRunMark MR = new Model.FlowRunMark();
  77.             LRData.Add(MR);
  78.         }
  79.         GridView1.DataSource = LRData;
  80.         GridView1.DataBind();
  81.     }
  82.     /// <summary>
  83.     /// 操作
  84.     /// </summary>
  85.     /// <returns></returns>
  86.     public string CaoZuo()
  87.     {
  88.         string Id = Eval("YXID").ToString();
  89.   
  90.         string Rtstr = @" 
  91.                             <!--固定流程有流程编辑器选项 -->
  92.                            <img align=""absMiddle"" border=""0"" src=""../images/query.gif"" /><a href=""WorkView.aspx?id=" + Id + @"""><span style=""color: #0000ff;
  93.                                             text-decoration: underline"">查看办理情况</span>
  94.                           ";
  95.         return Rtstr;
  96.     }
  97.     /// <summary>
  98.     /// 流程
  99.     /// </summary>
  100.     /// <returns></returns>
  101.     public string LiuCheng()
  102.     {
  103.         string Rtstr = "请假";
  104.         string Id = Eval("LCID").ToString();
  105.         Rtstr = EnumGet.GetFlowBaseName(int.Parse(Id));
  106.         Rtstr = "<a href='WorkFlowView.aspx?lcid=" + Id + "' target='_blank'>" + Rtstr + "</a>";
  107.         return Rtstr;
  108.     }
  109. }