finish_list.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:5k
源码类别:
OA系统
开发平台:
ASP/ASPX
- using System;
- using System.Data;
- using System.Data.SqlClient;
- using System.Configuration;
- using System.Collections;
- 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 web_equipment_finish_list : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- LoginDAO.CheckLogin(Session, Response, "../../", 2);
- GridView1.DataKeyNames = new string[] { "form_id" };
- }
- if (Request.QueryString["form_id"] != null)
- {
- this.SetData(Request.QueryString["form_id"]);
- this.SetTable(Request.QueryString["form_id"]);
- }
- }
- public void SetData(string id)
- {
- MultiView2.ActiveViewIndex = 0;
- GridView2.Visible = true;
- Label3.Text = id;
- }
- public void SetTable(string id)
- {
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- SqlCommand cmd = new SqlCommand("select operator_id,is_check,is_agree,comment,check_date,step from oa_equipment_flow where form_id='" + id + "'", conn);
- SqlDataReader dr = cmd.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- TableRow tr = new TableRow();
- TableCell td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["step"].ToString();
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- SqlCommand sqlcom = new SqlCommand("select emp_name from oa_employee where id='" + dr["operator_id"] + "'", conn1);
- td.Text = sqlcom.ExecuteScalar().ToString();
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = "審批";
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- if (dr["is_check"].ToString().Equals("N"))
- {
- td.Text = "未處理";
- }
- else
- {
- td.Text = "已處理";
- }
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- if (dr["is_check"].ToString().Equals("Y"))
- {
- if (dr["is_agree"].ToString().Equals("Y"))
- {
- td.Text = "已同意";
- }
- else
- {
- td.Text = "不同意";
- }
- }
- else
- {
- td.Text = "<br>";
- }
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- if (!dr["comment"].ToString().Equals(""))
- {
- td.Text = dr["comment"].ToString();
- }
- else
- {
- td.Text = "<br>";
- }
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- if (!dr["check_date"].ToString().Equals(""))
- {
- td.Text = dr["check_date"].ToString();
- }
- else
- {
- td.Text = "<br>";
- }
- tr.Cells.Add(td);
- this.FlowTable.Rows.Add(tr);
- }
- }
- }
- protected void ShowMessageBox(string strMessage)
- {
- Response.Write(string.Format("<script>alert('{0}')</script>", strMessage));
- }
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- int i = 0;
- //执行循环,保证每条数据都可以更新
- for (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='#00A9FF'");
- //当鼠标移开时还原背景色
- e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
- }
- }
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- e.Row.Attributes.Add("onmouseover", "this.style.cursor='pointer';");
- e.Row.Attributes.Add("onclick", "location.href='finish_list.aspx?form_id=" + GridView1.DataKeys[e.Row.RowIndex].Value.ToString() + "'");
- }
- }
- }