WorkList.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:4k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections.Generic;
- 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;
- public partial class Work_WorkList : System.Web.UI.Page
- {
- /// <summary>
- /// 模板
- /// </summary>
- Model.FlowRun MR = new Model.FlowRun();
- /// <summary>
- /// 业务
- /// </summary>
- BLL.FlowRun BR = new BLL.FlowRun();
- /// <summary>
- /// 查询条件
- /// </summary>
- public string TiaoJian
- {
- get
- {
- if (ViewState["Work_WorkListTiaoJian"] == null)
- {
- return "";
- }
- else
- {
- return ViewState["Work_WorkListTiaoJian"].ToString();
- }
- }
- set { ViewState["Work_WorkListTiaoJian"] = value; }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "Work_WorkList");
- if (!IsPostBack)
- {
- MyDataBind(1);
- }
- }
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- for (int i = 0; i < GridView1.Rows.Count; i++)
- {
- //首先判断是否是数据行
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- //当鼠标停留时更改背景色
- e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#F0F0F0'");
- //当鼠标移开时还原背景色
- e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
- }
- }
- }
- protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
- {
- MyDataBind(e.NewPageIndex);
- }
- /// <summary>
- /// 获取信息
- /// </summary>
- /// <param name="pidx">页号</param>
- public void MyDataBind(int pidx)
- {
- TiaoJian = "YXZT='运行中' and XBR='"+SessionInclude.SessionId+"'";
- AspNetPager1.RecordCount = BR.GetCount(TiaoJian);
- List<Model.FlowRun> LRData = BR.GetPageList(20, pidx, "ID", false, TiaoJian);
- if (LRData.Count == 0)
- {
- Model.FlowRun MR = new Model.FlowRun();
- LRData.Add(MR);
- }
- GridView1.DataSource = LRData;
- GridView1.DataBind();
- }
- /// <summary>
- /// 操作
- /// </summary>
- /// <returns></returns>
- public string CaoZuo()
- {
- string Id = Eval("Id").ToString();
-
- string Rtstr = @"
- <!--固定流程有流程编辑器选项 -->
- <a href=""WorkEdit.aspx?id=" + Id + @""">
- <img align=""absMiddle"" border=""0"" height=""13"" src=""../images/arrow_down.gif"" width=""11"" /><span
- style=""color: #0000ff; text-decoration: underline""> 办理 </span></a> <img align=""absMiddle"" border=""0"" src=""../images/query.gif"" /><a href=""WorkView.aspx?id=" + Id + @"""><span style=""color: #0000ff;
- text-decoration: underline"">查看办理情况</span>
- ";
- return Rtstr;
- }
- /// <summary>
- /// 流程
- /// </summary>
- /// <returns></returns>
- public string LiuCheng()
- {
- string Rtstr = "请假";
- string Id = Eval("LCID").ToString();
- Rtstr = EnumGet.GetFlowBaseName(int.Parse(Id));
- Rtstr = "<a href='WorkFlowView.aspx?lcid=" + Id + "' target='_blank'>" + Rtstr + "</a>";
- return Rtstr;
- }
- /// <summary>
- /// 已用时
- /// </summary>
- /// <returns></returns>
- public string HaoFeiShiJian()
- {
- DateTime ZHCZSJ =DateTime.Parse(Eval("ZHCZSJ").ToString());
- string RtStr = "";
- RtStr=TimeSpan.FromTicks(DateTime.Now.Ticks - ZHCZSJ.Ticks).ToString();
- return RtStr;
- }
- }