top.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:3k
源码类别:
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)
- {
- if (!IsPostBack)
- {
- string place = string.Empty;
- 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 conn = dbConnection.getConnection();
- conn.Open();
- SqlCommand sqlcom = new SqlCommand("select place from oa_employee where id=" + user.Id, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- place = dr["place"].ToString().Trim();
- }
- }
- }
- Response.Write("<meta http-equiv='refresh' content='600'/> ");
- }
- /*ArrayList myarray = new ArrayList();
- Weather myweather = new Weather();
- if (place.Equals(""))
- {
- place = "上海";
- }
- myarray = myweather.GetWeather(place);
- LinkButton1.Text = myarray[0].ToString();
- Label1.Text = myarray[1].ToString();
- string str = myarray[2].ToString() + "~" + myarray[3].ToString();
- Label2.Text = str.Trim();*/
- }
- }
- protected void BtnReLogin_Click(object sender, EventArgs e)
- {
- Session.RemoveAll();
- Response.Write("<script language='javascript'>window.parent.location.href='login.aspx'</script>");
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- Response.Redirect("Default.aspx");
- }
- protected void LinkButton1_Click(object sender, EventArgs e)
- {
- Response.Write(" <script>window.open('select_weather.aspx','_blank','left=262 top=180 height=340 width=560 scrollbars=no, resizable = no, status = no, toolbar = no, menubar = no') </script>");
- }
- }