Default.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:6k
源码类别:
OA系统
开发平台:
ASP/ASPX
- using System;
- using System.Text;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Data.SqlClient;
- 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_Default : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- int id = 1;
- ArrayList num1 = new ArrayList();
- ArrayList num2 = new ArrayList();
- decimal T1 = 113000;
- decimal T2 = 130000;
- decimal T3 = 150000;
- decimal T4 = 173000;
- SqlConnection conn1 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm1 = new SqlCommand("select distinct data from dbo.OA_KAOQIN ", conn1);
- conn1.Open();
- System.Data.SqlClient.SqlDataReader comm1 = sqlcomm1.ExecuteReader();
- while (comm1.Read())
- {
- num1.Add(comm1["data"]);
- }
- comm1.Close();
- conn1.Close();
- // num1.Add(comm1["data"]);
- SqlConnection conn6 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm6 = new SqlCommand("select card_id from dbo.OA_KAOQIN", conn6);
- conn6.Open();
- System.Data.SqlClient.SqlDataReader comm6 = sqlcomm6.ExecuteReader();
- while (comm6.Read())
- {
- num2.Add(comm6["card_id"]);
- }
- comm6.Close();
- conn6.Close();
- foreach (decimal i in num1)
- {
- foreach (string j in num2)
- {
- string time1 = null;
- string time2 = null;
- string time3 = null;
- string time4 = null;
- SqlConnection conn2 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm2 = new SqlCommand("select min(card_time) as card_time from dbo.OA_KAOQIN where data = " + i + " and card_id = " +j + " and card_time <" + T1, conn2);
- conn2.Open();
- System.Data.SqlClient.SqlDataReader comm2 = sqlcomm2.ExecuteReader();
- while (comm2.Read())
- {
- time1 = Convert.ToString(comm2["card_time"]);
- }
- comm2.Close();
- conn2.Close();
- SqlConnection conn3 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm3 = new SqlCommand("select min(card_time) as card_time from dbo.OA_KAOQIN where data = " + i + "and card_id = " + j + "and card_time >" + T1 + "and card_time<" + T2, conn3);
- conn3.Open();
- System.Data.SqlClient.SqlDataReader comm3 = sqlcomm3.ExecuteReader();
- while (comm3.Read())
- {
- time2 = Convert.ToString(comm3["card_time"]);
- }
- comm3.Close();
- conn3.Close();
- SqlConnection conn4 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm4 = new SqlCommand("select max(card_time) as card_time from dbo.OA_KAOQIN where data = " + i + "and card_id = " + j + "and card_time >" + T1 + "and card_time <" + T3, conn4);
- conn4.Open();
- System.Data.SqlClient.SqlDataReader comm4 = sqlcomm4.ExecuteReader();
- while (comm4.Read())
- {
- time3 = Convert.ToString(comm4["card_time"]);
- }
- comm4.Close();
- conn4.Close();
- SqlConnection conn5 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm5 = new SqlCommand("select max(card_time) as card_time from dbo.OA_KAOQIN where data = " + i+ "and card_id = " + j + "and card_time > " + T3 + "and card_time < " + T4, conn5);
- conn5.Open();
- System.Data.SqlClient.SqlDataReader comm5 = sqlcomm5.ExecuteReader();
- while (comm5.Read())
- {
- time4 = Convert.ToString(comm5["card_time"]);
- }
- comm5.Close();
- conn5.Close();
- SqlConnection conn7 = dbConnection.getConnection();
- conn7.Open();
- SqlCommand cmd = new SqlCommand("insert into OA_KAOQIN_JL(id ,data ,1, card_id,zao, wan, wuxia,wushang )values('" + id + "','" + i + "','" + j + "','" + time1 + "','" + time4 + "','" + time2 + "','" + time3 + "')", conn7);
- id = id + 1;
- cmd.ExecuteNonQuery();
- Response.Write(i);
- Response.Write(" " );
- Response.Write(j);
- Response.Write(" ");
- Response.Write(time1);
- Response.Write(" " );
- Response.Write(time2);
- Response.Write( " " );
- Response.Write(time3);
- Response.Write( " " );
- Response.Write(time4);
- conn7.Close();
- }
- }
- }
- }