SearchWorkList.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:5k
- 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_SearchWorkList : 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_SearchWorkListTiaoJian"] == null)
- {
- return "";
- }
- else
- {
- return ViewState["Work_SearchWorkListTiaoJian"].ToString();
- }
- }
- set { ViewState["Work_SearchWorkListTiaoJian"] = value; }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "Work_SearchWorkList");
- if (!IsPostBack)
- {
- KeyValue_YHMC.Text = SessionInclude.SessionId;
- DropLoadSet();
- TiaoJian = "";
- 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)
- {
-
- 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 = @"
- <!--固定流程有流程编辑器选项 -->
- <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;
- }
- public void DropLoadSet()
- {
- //流程
- KeyValue_LCFL.DataTextField = "LCMC";
- KeyValue_LCFL.DataValueField = "ID";
- KeyValue_LCFL.DataSource = EnumGet.FlowBaseGetEnum();
- KeyValue_LCFL.DataBind();
- KeyValue_LCFL.SelectedIndex = KeyValue_LCFL.Items.Count - 1;
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- string SqlStr = "LCID=" + KeyValue_LCFL.SelectedValue;
- SqlStr+= " and YXZT='" + KeyValue_YXZT.Text+ "'";
- SqlStr+= " and FQR='" + KeyValue_YHMC.Text + "'";
- if ((DateTimeTextBox1.Text != "") && (DateTimeTextBox2.Text != ""))
- {
- SqlStr+= " and FQSJ>='" + DateTimeTextBox1.Text + "' and FQSJ<='" + DateTimeTextBox2.Text + "'";
- }
- TiaoJian = SqlStr;
- if (RunID_TextBox.Text != "")
- {
- int RunID_Value = 0;
- if (int.TryParse(RunID_TextBox.Text, out RunID_Value))
- {
- TiaoJian = "ID=" + RunID_Value.ToString();
- }
- else
- {
- MessageBox.Show("运行ID必须为数字!");
-
- }
- }
- MyDataBind(1);
- }
- }