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_equipment_deal_list : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.        this.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_date as f_apply_date,f.form_id as f_form_id from oa_equipment_form as f,oa_equipment_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 + "'", 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.                 try
  42.                 {
  43.                     td.Text = sqlcom.ExecuteScalar().ToString();
  44.                 }
  45.                 catch
  46.                 {
  47.                 }
  48.                 tr.Cells.Add(td);
  49.                 td = new TableCell();
  50.                 td.BorderWidth = Unit.Pixel(1);
  51.                 SqlCommand sqlcom1 = new SqlCommand("select emp_name from oa_employee where id='" + dr["f_emp_id"].ToString() + "'", conn1);
  52.                 try
  53.                 {
  54.                     str = sqlcom1.ExecuteScalar().ToString();
  55.                     td.Text = sqlcom1.ExecuteScalar().ToString() + "的設備申請單";
  56.                 }
  57.                 catch
  58.                 {
  59.                 }
  60.                 tr.Cells.Add(td);
  61.                 td = new TableCell();
  62.                 td.BorderWidth = Unit.Pixel(1);
  63.                 td.Text = dr["f_apply_date"].ToString();
  64.                 tr.Cells.Add(td);
  65.                 td = new TableCell();
  66.                 td.BorderWidth = Unit.Pixel(1);
  67.                 HyperLink hl = new HyperLink();
  68.                 hl.Text = "查看";
  69.                 hl.NavigateUrl = "deal.aspx?form_id=" + dr["f_form_id"].ToString() + "&emp_name=" + str;
  70.                 td.Controls.Add(hl);
  71.                 tr.Cells.Add(td);
  72.                 TblFlow.Rows.Add(tr);
  73.                 conn1.Close();
  74.             }
  75.         }
  76.         dr.Close();
  77.         conn.Close();
  78.     }
  79. }