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

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_MyWorkList : 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_MyWorkList");
  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 = "FQR='"+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.         try
  89.         {
  90.             string Id = Eval("Id").ToString();
  91.             string ToId = Eval("XBR").ToString();
  92.             string Rtstr = @" 
  93.                             <!--固定流程有流程编辑器选项 -->
  94.                          &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> &nbsp;&nbsp; ";
  96.             if (Eval("YXZT").ToString() == "运行中")
  97.             {
  98.                 Rtstr += @"<a onclick=""javascript:return confirm('您确定是否销毁?')"" href=""WorkDestroy.aspx?id=" + Id + @""">
  99.                                 <img align=""absMiddle"" border=""0"" height=""13"" src=""../images/arrow_down.gif"" width=""11"" /><span
  100.                                     style=""color: #0000ff; text-decoration: underline""> 销毁 </span></a>&nbsp;&nbsp;
  101. <a o href=""../SMS/MySMSSendTo.aspx?id=" + Server.UrlEncode(ToId) + @""">
  102.      <img align=""absMiddle"" border=""0"" height=""13"" src=""../images/arrow_down.gif"" width=""11"" /><span
  103.                                     style=""color: #0000ff; text-decoration: underline""> 催办 </span></a>
  104.                           ";
  105.             }
  106.             else
  107.             {
  108.                 Rtstr += @"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  109.             }
  110.             return Rtstr;
  111.         }
  112.         catch
  113.         { return ""; }
  114.     }
  115.     /// <summary>
  116.     /// 流程
  117.     /// </summary>
  118.     /// <returns></returns>
  119.     public string LiuCheng()
  120.     {
  121.         string Rtstr = "请假";
  122.         string Id = Eval("LCID").ToString();
  123.         Rtstr = EnumGet.GetFlowBaseName(int.Parse(Id));
  124.         Rtstr = "<a href='WorkFlowView.aspx?lcid=" + Id + "' target='_blank'>" + Rtstr + "</a>";
  125.         return Rtstr;
  126.     }
  127. }