finish_list.aspx.cs
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:6k
源码类别:

OA系统

开发平台:

ASP/ASPX

  1. using System;
  2. using System.Data;
  3. using System.Data.SqlClient;
  4. using System.Configuration;
  5. using System.Collections;
  6. using System.Web;
  7. using System.Web.Security;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.WebControls.WebParts;
  11. using System.Web.UI.HtmlControls;
  12. public partial class web_data_repair_finish_list : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.         if (!IsPostBack)
  17.         {
  18.             LoginDAO.CheckLogin(Session, Response, "../../", 2);
  19.             GridView1.DataKeyNames = new string[] { "form_id" };
  20.         }
  21.         if (Request.QueryString["form_id"] != null)
  22.         {
  23.             this.SetData(Request.QueryString["form_id"]);
  24.             this.SetTable(Request.QueryString["form_id"]);
  25.         }
  26.     }
  27.     public void SetData(string id)
  28.     {
  29.         MultiView2.ActiveViewIndex = 0;
  30.         FormTable.Visible = true;
  31.         lb_no.Text = id;
  32.     }
  33.     public void SetTable(string id)
  34.     {
  35.         SqlConnection conn = dbConnection.getConnection();
  36.         conn.Open();
  37.         SqlCommand cmd = new SqlCommand("select operator_id,is_check,is_agree,comment,check_time,step from OA_REPAIR_FLOW where form_id='" + id + "'", conn);
  38.         SqlDataReader dr = cmd.ExecuteReader();
  39.         if (dr.HasRows)
  40.         {
  41.             while (dr.Read())
  42.             {
  43.                 TableRow tr = new TableRow();
  44.                 TableCell td = new TableCell();
  45.                 td.BorderWidth = Unit.Pixel(1);
  46.                 td.Text = dr["step"].ToString();
  47.                 tr.Cells.Add(td);
  48.                 td = new TableCell();
  49.                 td.BorderWidth = Unit.Pixel(1);
  50.                 SqlConnection conn1 = dbConnection.getConnection();
  51.                 conn1.Open();
  52.                 SqlCommand sqlcom = new SqlCommand("select emp_name from oa_employee where id='" + dr["operator_id"] + "'", conn1);
  53.                 td.Text = sqlcom.ExecuteScalar().ToString();
  54.                 tr.Cells.Add(td);
  55.                 td = new TableCell();
  56.                 td.BorderWidth = Unit.Pixel(1);
  57.                 td.Text = "審批";
  58.                 tr.Cells.Add(td);
  59.                 td = new TableCell();
  60.                 td.BorderWidth = Unit.Pixel(1);
  61.                 if (dr["is_check"].ToString().Equals("N"))
  62.                 {
  63.                     td.Text = "未處理";
  64.                 }
  65.                 else
  66.                 {
  67.                     td.Text = "已處理";
  68.                 }
  69.                 tr.Cells.Add(td);
  70.                 td = new TableCell();
  71.                 td.BorderWidth = Unit.Pixel(1);
  72.                 if (dr["is_check"].ToString().Equals("Y"))
  73.                 {
  74.                     if (dr["is_agree"].ToString().Equals("Y"))
  75.                     {
  76.                         td.Text = "已完工";
  77.                     }
  78.                     else
  79.                     {
  80.                         td.Text = "未完工";
  81.                     }
  82.                 }
  83.                 else
  84.                 {
  85.                     td.Text = "<br>";
  86.                 }
  87.                 tr.Cells.Add(td);
  88.                 td = new TableCell();
  89.                 td.BorderWidth = Unit.Pixel(1);
  90.                 if (!dr["comment"].ToString().Equals(""))
  91.                 {
  92.                     td.Text = dr["comment"].ToString();
  93.                 }
  94.                 else
  95.                 {
  96.                     td.Text = "<br>";
  97.                 }
  98.                 tr.Cells.Add(td);
  99.                 td = new TableCell();
  100.                 td.BorderWidth = Unit.Pixel(1);
  101.                 if (!dr["check_time"].ToString().Equals(""))
  102.                 {
  103.                     td.Text = dr["check_time"].ToString();
  104.                 }
  105.                 else
  106.                 {
  107.                     td.Text = "<br>";
  108.                 }
  109.                 tr.Cells.Add(td);
  110.                 this.FlowTable.Rows.Add(tr);
  111.             }
  112.         }
  113.         dr.Close();
  114.         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);
  115.         SqlDataReader dr1 = sqlcom1.ExecuteReader();
  116.         if (dr1.HasRows)
  117.         {
  118.             while (dr1.Read())
  119.             {
  120.                 lb_department.Text = dr1["name"].ToString();
  121.                 lb_equipment.Text = dr1["eq_detail"].ToString();
  122.                 lb_person.Text = dr1["emp_name"].ToString();
  123.                 lb_tel.Text = dr1["tel"].ToString();
  124.                 lb_type.Text = dr1["eq_type"].ToString();
  125.                 comment.Text = dr1["content"].ToString();
  126.                 company.Text = dr1["company"].ToString();
  127.             }
  128.         }
  129.         dr1.Close();
  130.         conn.Close();
  131.     }
  132.     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  133.     {
  134.         if (e.Row.RowType == DataControlRowType.DataRow)
  135.         {
  136.             e.Row.Attributes.Add("onmouseover", "this.style.cursor='pointer';");
  137.             e.Row.Attributes.Add("onclick", "location.href='my_list.aspx?form_id=" + GridView1.DataKeys[e.Row.RowIndex].Value.ToString() + "'");
  138.         }
  139.     }
  140.     protected void ShowMessageBox(string strMessage)
  141.     {
  142.         Response.Write(string.Format("<script>alert('{0}')</script>", strMessage));
  143.     }
  144. }