top1.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:9k
源码类别:
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_top : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- int i = 0;
- int k = 0;
- int num1=0;
- int num2=0;
- int num3=0;
- int num4 = 0;
- string[] myarray= new string[100000];
- DateMgr mgr = new DateMgr();
- string today = mgr.getDate();
- SqlConnection sqlconn1 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm1 = new SqlCommand("select subject from dbo.OA_ANNOUNCEMENT where validate_date >='"+today+"'", sqlconn1);
- sqlconn1.Open();
- System.Data.SqlClient.SqlDataReader comm1 =sqlcomm1.ExecuteReader();
- Response.Write("<marquee onmouseover=stop() onmouseout=start() width=300px style='left: 400px; position: absolute; top: 75px' scrollDelay=200 >");
- while (comm1.Read())
- {
- myarray[i]=comm1["subject"].ToString();
- i=i+1;
- }
- for (int j = 0; j < myarray.Length; j++)
- {
- if(myarray[j]!=null)
- Response.Write("<a href='announcement/announce_list.aspx?type_id=1'" + " target=_blank>" + myarray[j] + " ");
- }
- Response.Write("</marquee>");
- comm1.Close();
- sqlconn1.Close();
- if (!IsPostBack)
- {
- if (Application["TITLE"] != null)
- {
- LblTitle.Text = Application["TITLE"].ToString();
- BtnReLogin.Text = "登出";
- BtnReLogin.OnClientClick = "return confirm('確定要登出嗎?')";
- HlWhere.Text = "大家在哪裡";
- if (Session["user"] != null)
- {
- User user = (User)Session["user"];
- LblInfo.Text = "當前用戶: " + user.Emp_no + " " + user.Emp_name + user.Position;
- SqlConnection sqlconn2 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm2 = new SqlCommand("select distinct id from dbo.OA_TW_APPROVEL_FORM as f where f.state=1", sqlconn2);
- sqlconn2.Open();
- SqlDataReader comm2 = sqlcomm2.ExecuteReader();
- while (comm2.Read())
- {
- SqlConnection sqlconn3 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm3 = new SqlCommand("select top 1 * from dbo.OA_TW_APPROVEL_FORM_FLOW as f where f.is_check='N'and f.form_id=" + comm2["id"] + "order by form_id", sqlconn3);
- sqlconn3.Open();
- SqlDataReader comm3 = sqlcomm3.ExecuteReader();
- while (comm3.Read())
- {
- k = Convert.ToInt32(comm3["operator_id"]);
- if (k == user.Id )
- {
- num1 = num1 + 1;
- }
- }
- comm3.Close();
- sqlconn3.Close();
- }
- comm2.Close();
- sqlconn2.Close();
- SqlConnection sqlconn4 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm4 = new SqlCommand("select distinct id from dbo.OA_CH_BUSINESS_FORM as f where f.state=1", sqlconn4);
- sqlconn4.Open();
- SqlDataReader comm4 = sqlcomm4.ExecuteReader();
- while (comm4.Read())
- {
- SqlConnection sqlconn5 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm5 = new SqlCommand("select top 1 * from dbo.OA_CH_APPROVEL_FORM_FLOW as f where f.is_business='Y'and f.is_check='N'and f.form_id=" + comm4["id"]+ "order by f.form_id", sqlconn5);
- sqlconn5.Open();
- SqlDataReader comm5 = sqlcomm5.ExecuteReader();
- while (comm5.Read())
- {
- k = Convert.ToInt32(comm5["operator_id"]);
- if (k == user.Id)
- {
- num2 = num2 + 1;
- }
- }
- comm5.Close();
- sqlconn5.Close();
- }
- comm4.Close();
- sqlconn4.Close();
- SqlConnection sqlconn6 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm6 = new SqlCommand("select distinct id from dbo.OA_CH_OFF_FORM as f where f.state=1", sqlconn6);
- sqlconn6.Open();
- SqlDataReader comm6 = sqlcomm6.ExecuteReader();
- while (comm6.Read())
- {
- SqlConnection sqlconn7 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm7 = new SqlCommand("select top 1 * from dbo.OA_CH_APPROVEL_FORM_FLOW as f where f.is_business='N'and f.is_check='N'and f.form_id=" + comm6["id"] + "order by f.form_id", sqlconn7);
- sqlconn7.Open();
- SqlDataReader comm7 = sqlcomm7.ExecuteReader();
- while (comm7.Read())
- {
- k = Convert.ToInt32(comm7["operator_id"]);
- if (k == user.Id)
- {
- num4 = num4 + 1;
- }
- }
- comm7.Close();
- sqlconn7.Close();
- }
- comm6.Close();
- sqlconn6.Close();
- num2 = num2 + num4;
- SqlConnection sqlconn8 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm8 = new SqlCommand("select distinct form_id from dbo.OA_FAIR_FORM_FLOW", sqlconn8);
- sqlconn8.Open();
- SqlDataReader comm8 = sqlcomm8.ExecuteReader();
- while (comm8.Read())
- {
- SqlConnection sqlconn9 = dbConnection.getConnection();
- System.Data.SqlClient.SqlCommand sqlcomm9 = new SqlCommand("select top 1 * from dbo.OA_FAIR_FORM_FLOW as f where f.is_check='N'and f.form_id=" + comm8["form_id"] + "order by f.form_id", sqlconn9);
- sqlconn9.Open();
- SqlDataReader comm9 = sqlcomm9.ExecuteReader();
- while (comm9.Read())
- {
- k = Convert.ToInt32(comm9["operator_id"]);
- if (k == user.Id)
- {
- num3 = num3 + 1;
- }
- }
- comm9.Close();
- sqlconn9.Close();
- }
- comm8.Close();
- sqlconn8.Close();
- Response.Write("<marquee onmouseover=stop() onmouseout=start() width=250px Height=70px style='left: 400px; position: absolute; top: 2px' direction=up BEHAVIOR=SCROLL SCROLLAMOUNT=10 scrollDelay=400 >");
- if (num1 != 0)
- {
- Response.Write("<a href='approvel/tw/deal_list.aspx'" + " target=_blank>" + "您有" + num1 + "个台幹申請單需要審核 </br></br>");
- }
- if (num2 != 0)
- {
- Response.Write("<a href='approvel/ch/deal_list.aspx'" + " target=_blank>" + "您有" + num2 + "个中幹申請單需要審核</br> </br>");
- }
- if (num3 != 0)
- {
- Response.Write("<a href='fair/deal_list.aspx'" + " target=_blank>" + "您有" + num3 + "个費用申請單需要審核</br> </br>");
- }
- Response.Write("</marquee>");
- }
- Response.Write("<meta http-equiv='refresh' content='600'/> ");
- }
- }
- }
- protected void BtnReLogin_Click(object sender, EventArgs e)
- {
- Session.RemoveAll();
- Response.Write("<script language='javascript'>window.parent.location.href='login.aspx'</script>");
- }
- }