WorkFlowStepSetting.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 WorkFlow_WorkFlowStepSetting : System.Web.UI.Page
  12. {
  13.     /// <summary>
  14.     /// 模板
  15.     /// </summary>
  16.     Model.FlowBaseStep MR = new Model.FlowBaseStep();
  17.     /// <summary>
  18.     /// 业务
  19.     /// </summary>
  20.     BLL.FlowBaseStep BR = new BLL.FlowBaseStep();
  21.    public string lcflidStr = "";
  22.     public string lcidStr = "";
  23.     public string bdidStr = "";
  24.     protected void Page_Load(object sender, EventArgs e)
  25.     {
  26.         LoginLogic.MatchLoad("../", "WorkFlow_WorkFlowStepSetting");
  27.         if (!IsPostBack)
  28.         {
  29.             object lcflid = Request.QueryString["lcflid"];//流程分类ID
  30.             object lcid = Request.QueryString["lcid"];//流程ID
  31.             object bdid = Request.QueryString["bdid"];//表单ID
  32.             if ((lcflid != null) && (lcid != null) && (bdid != null))
  33.             {
  34.                 lcflidStr = lcflid.ToString();
  35.                 lcidStr = lcid.ToString();
  36.                 bdidStr = bdid.ToString();
  37.             }
  38.             MyDataBind();
  39.         }
  40.     }
  41.     /// <summary>
  42.     /// 获取信息
  43.     /// </summary>
  44.     /// <param name="pidx">页号</param>
  45.     public void MyDataBind()
  46.     {
  47.         string TiaoJian = "";
  48.         if (Request.QueryString["lcid"] != null)
  49.         {
  50.             TiaoJian = "LCID=" + Request.QueryString["lcid"].ToString();
  51.         }
  52.         int RecordCount = BR.GetCount(TiaoJian);
  53.         if(RecordCount>0)
  54.         {
  55.         List<Model.FlowBaseStep> LRData = BR.GetPageList(RecordCount, 1, "BZSXH", true, TiaoJian);
  56.         if (LRData.Count == 0)
  57.         {
  58.             Model.FlowBaseStep MR = new Model.FlowBaseStep();
  59.             LRData.Add(MR);
  60.         }
  61.         GridView1.DataSource = LRData;
  62.         GridView1.DataBind();
  63.         }
  64.     }
  65.     protected void Button1_Click(object sender, EventArgs e)
  66.     {
  67.         Response.Redirect("WorkFlowStepAdd.aspx?lcflid=" + Request.QueryString["lcflid"].ToString() + "&lcid=" + Request.QueryString["lcid"].ToString() + "&bdid=" + Request.QueryString["bdid"].ToString());
  68.     }
  69.     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  70.     {
  71.         for (int i = 0; i < GridView1.Rows.Count; i++)
  72.         {
  73.             //首先判断是否是数据行
  74.             if (e.Row.RowType == DataControlRowType.DataRow)
  75.             {
  76.                 //当鼠标停留时更改背景色
  77.                 e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#F0F0F0'");
  78.                 //当鼠标移开时还原背景色
  79.                 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
  80.             }
  81.         }
  82.     }
  83.     protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
  84.     {
  85.         string ID = GridView1.Rows[e.RowIndex].Cells[0].Text.ToString().Trim();
  86.         BR.Delete(int.Parse(ID));
  87.         MessageBox.Show("删除成功!");
  88.         MyDataBind();
  89.     }
  90. }