finish_list.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:6k
源码类别:
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_data_repair_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;
- FormTable.Visible = true;
- lb_no.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_time,step from OA_REPAIR_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_time"].ToString().Equals(""))
- {
- td.Text = dr["check_time"].ToString();
- }
- else
- {
- td.Text = "<br>";
- }
- tr.Cells.Add(td);
- this.FlowTable.Rows.Add(tr);
- }
- }
- dr.Close();
- SqlCommand sqlcom1 = new SqlCommand("select b.emp_name as emp_name,c.name as name,c.tel as tel,a.eq_type as eq_type,a.eq_detail as eq_detail,a.content as content,a.company as company from OA_REPAIR_FORM_DETAIL AS a,OA_EMPLOYEE as b,OA_DEPARTMENT as c,OA_REPAIR_FORM as d where a.form_id=d.form_id and b.id=d.emp_id and c.id=a.department_id and a.form_id='" + Request.QueryString["form_id"].ToString() + "'", conn);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- lb_department.Text = dr1["name"].ToString();
- lb_equipment.Text = dr1["eq_detail"].ToString();
- lb_person.Text = dr1["emp_name"].ToString();
- lb_tel.Text = dr1["tel"].ToString();
- lb_type.Text = dr1["eq_type"].ToString();
- comment.Text = dr1["content"].ToString();
- company.Text = dr1["company"].ToString();
- }
- }
- dr1.Close();
- conn.Close();
- }
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- e.Row.Attributes.Add("onmouseover", "this.style.cursor='pointer';");
- e.Row.Attributes.Add("onclick", "location.href='my_list.aspx?form_id=" + GridView1.DataKeys[e.Row.RowIndex].Value.ToString() + "'");
- }
- }
- protected void ShowMessageBox(string strMessage)
- {
- Response.Write(string.Format("<script>alert('{0}')</script>", strMessage));
- }
- }