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

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_WorkList : System.Web.UI.Page
  12. {
  13.     /// <summary>
  14.     /// 模板 
  15.     /// </summary>
  16.     Model.FlowRun MR = new Model.FlowRun();
  17.     /// <summary>
  18.     /// 业务
  19.     /// </summary>
  20.     BLL.FlowRun BR = new BLL.FlowRun();
  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 = "YXZT='运行中' and XBR='"+SessionInclude.SessionId+"'";
  72.         AspNetPager1.RecordCount = BR.GetCount(TiaoJian);
  73.         List<Model.FlowRun> LRData = BR.GetPageList(20, pidx, "ID", false, TiaoJian);
  74.         if (LRData.Count == 0)
  75.         {
  76.             Model.FlowRun MR = new Model.FlowRun();
  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("Id").ToString();
  89.   
  90.         string Rtstr = @" 
  91.                             <!--固定流程有流程编辑器选项 -->
  92.                             <a href=""WorkEdit.aspx?id=" + Id + @""">
  93.                                 <img align=""absMiddle"" border=""0"" height=""13"" src=""../images/arrow_down.gif"" width=""11"" /><span
  94.                                     style=""color: #0000ff; text-decoration: underline""> 办理 </span></a>&nbsp;&nbsp;<img align=""absMiddle"" border=""0"" src=""../images/query.gif"" /><a href=""WorkView.aspx?id=" + Id + @"""><span style=""color: #0000ff;
  95.                                             text-decoration: underline"">查看办理情况</span>
  96.                           ";
  97.         return Rtstr;
  98.     }
  99.     /// <summary>
  100.     /// 流程
  101.     /// </summary>
  102.     /// <returns></returns>
  103.     public string LiuCheng()
  104.     {
  105.         string Rtstr = "请假";
  106.         string Id = Eval("LCID").ToString();
  107.         Rtstr = EnumGet.GetFlowBaseName(int.Parse(Id));
  108.         Rtstr = "<a href='WorkFlowView.aspx?lcid=" + Id + "' target='_blank'>" + Rtstr + "</a>";
  109.         return Rtstr;
  110.     }
  111.     /// <summary>
  112.     /// 已用时
  113.     /// </summary>
  114.     /// <returns></returns>
  115.     public string HaoFeiShiJian()
  116.     {
  117.         DateTime ZHCZSJ =DateTime.Parse(Eval("ZHCZSJ").ToString());
  118.         string RtStr = "";
  119.        RtStr=TimeSpan.FromTicks(DateTime.Now.Ticks - ZHCZSJ.Ticks).ToString();
  120.        return RtStr;
  121.     }
  122. }