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

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_Default3 : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.         string nul = " 256";
  17.         SqlConnection conn1 = dbConnection.getConnection();
  18.         conn1.Open();
  19.         SqlCommand sqlcom5 = new SqlCommand("select banbie from OA_KAOQIN_PBB where data='2009-01-14' and emp_no='08b234'", conn1);
  20.         SqlDataReader comm5 = sqlcom5.ExecuteReader();
  21.         if (comm5 != null)
  22.         {
  23.             while (comm5.Read())
  24.             {
  25.                 TableRow tr4 = new TableRow();
  26.                 TableCell d3 = new TableCell();
  27.                 d3.BorderWidth = Unit.Pixel(1);
  28.                 Label label4 = new Label();
  29.                 label4.BorderStyle = BorderStyle.None;
  30.                 label4.Text = Convert.ToString(comm5["banbie"]);
  31.                 d3.Controls.Add(label4);
  32.                 tr4.Cells.Add(d3);
  33.                 SqlConnection conn2 = dbConnection.getConnection();
  34.                 conn2.Open();
  35.                 SqlCommand sqlcom6 = new SqlCommand("select bengin_time,end_time from oa_pos_type where department='怡豐店' and type='" + Convert.ToString(comm5["banbie"]) + "'", conn2);
  36.                 SqlDataReader comm6 = sqlcom6.ExecuteReader();
  37.                 if (comm6.HasRows)
  38.                 {
  39.                     while (comm6.Read())
  40.                     {
  41.                         TableCell d4 = new TableCell();
  42.                         d4.BorderWidth = Unit.Pixel(2);
  43.                         Table table3 = new Table();
  44.                         table3.BorderWidth = Unit.Pixel(2);
  45.                         TableRow trr1 = new TableRow();
  46.                         TableCell tt1 = new TableCell();
  47.                         tt1.BorderWidth = Unit.Pixel(1);
  48.                         Label label6 = new Label();
  49.                         label6.BorderStyle = BorderStyle.None;
  50.                         label6.Text = Convert.ToString(comm6["bengin_time"]);
  51.                         tt1.Controls.Add(label6);
  52.                         trr1.Cells.Add(tt1);
  53.                         TableCell tt2 = new TableCell();
  54.                         tt2.BorderWidth = Unit.Pixel(1);
  55.                         Label label5 = new Label();
  56.                         label5.BorderStyle = BorderStyle.None;
  57.                         label5.Text = Convert.ToString(comm6["end_time"]);
  58.                         tt2.Controls.Add(label5);
  59.                         trr1.Cells.Add(tt2);
  60.                         table3.Rows.Add(trr1);
  61.                         d4.Controls.Add(table3);
  62.                         tr4.Cells.Add(d4);
  63.                     }
  64.                 }
  65.                 else
  66.                 {
  67.                         TableCell d4 = new TableCell();
  68.                         d4.BorderWidth = Unit.Pixel(2);
  69.                         d4.Visible = true;
  70.                         Table table3 = new Table();
  71.                         table3.BorderWidth = Unit.Pixel(2);
  72.                         TableRow trr1 = new TableRow();
  73.                         TableCell tt1 = new TableCell();
  74.                         Label label6 = new Label();
  75.                         label6.BorderStyle = BorderStyle.None;
  76.                         label6.Text = " ";
  77.                         tt1.Controls.Add(label6);
  78.                         trr1.Cells.Add(tt1);
  79.                         TableCell tt2 = new TableCell();
  80.                         tt2.BorderWidth = Unit.Pixel(1);
  81.                         Label label5 = new Label();
  82.                         label5.BorderStyle = BorderStyle.None;
  83.                         label5.Text = "";
  84.                         tt2.Controls.Add(label5);
  85.                         trr1.Cells.Add(tt2);
  86.                         table3.Rows.Add(trr1);
  87.                         d4.Controls.Add(table3);
  88.                         tr4.Cells.Add(d4);
  89.                 }
  90.                     Table1.Rows.Add(tr4);
  91.                     comm6.Close();
  92.                     conn2.Close();
  93.                 }
  94.             
  95.         }
  96.         comm5.Close();
  97.         conn1.Close();
  98.     }
  99. }