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

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_deal_list : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.         SetTable();
  17.     }
  18.     public void SetTable()
  19.     {
  20.         string str = "";
  21.         SqlConnection conn = dbConnection.getConnection();
  22.         conn.Open();
  23.         string user_id = "0";
  24.         if (Session["user_id"] != null)
  25.         {
  26.             user_id = Session["user_id"].ToString();
  27.         }
  28.         SqlCommand cmd = new SqlCommand("select f.id as id,f.emp_id as f_emp_id,f.apply_time as f_apply_time,f.form_id as f_form_id from OA_REPAIR_FORM as f,OA_REPAIR_FLOW as g where f.form_id=g.form_id and f.step=g.step and g.is_check='N'and f.status=1 and g.operator_id='" + user_id + "' order by f.id desc", conn);
  29.         SqlDataReader dr = cmd.ExecuteReader();
  30.         if (dr.HasRows)
  31.         {
  32.             while (dr.Read())
  33.             {
  34.                 TblFlow.Visible = true;
  35.                 TableRow tr = new TableRow();
  36.                 TableCell td = new TableCell();
  37.                 td.BorderWidth = Unit.Pixel(1);
  38.                 SqlConnection conn1 = dbConnection.getConnection();
  39.                 conn1.Open();
  40.                 SqlCommand sqlcom = new SqlCommand("select emp_name from oa_employee where id='" + dr["f_emp_id"].ToString() + "'", conn1);
  41.                  td.Text = sqlcom.ExecuteScalar().ToString();
  42.                 tr.Cells.Add(td);
  43.                 td = new TableCell();
  44.                 td.BorderWidth = Unit.Pixel(1);
  45.                 SqlCommand sqlcom1 = new SqlCommand("select emp_name from oa_employee where id='" + dr["f_emp_id"].ToString() + "'", conn1);
  46.                 try
  47.                 {
  48.                     td.Text = sqlcom1.ExecuteScalar().ToString() + "的設備報修申請單";
  49.                 }
  50.                 catch
  51.                 {
  52.                 }
  53.                 tr.Cells.Add(td);
  54.                 td = new TableCell();
  55.                 td.BorderWidth = Unit.Pixel(1);
  56.                 td.Text = dr["f_apply_time"].ToString();
  57.                 tr.Cells.Add(td);
  58.                 td = new TableCell();
  59.                 td.BorderWidth = Unit.Pixel(1);
  60.                 HyperLink hl = new HyperLink();
  61.                 hl.Text = "查看";
  62.                 hl.NavigateUrl = "deal1.aspx?form_id=" + dr["f_form_id"].ToString() + "&emp_id=" + dr["f_emp_id"];
  63.                 td.Controls.Add(hl);
  64.                 tr.Cells.Add(td);
  65.                 TblFlow.Rows.Add(tr);
  66.                 conn1.Close();
  67.             }
  68.         }
  69.         dr.Close();
  70.         conn.Close();
  71.     }
  72. }