📄 accounts_user.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using OI.DatabaseOper ;
namespace OI.Manage
{
/// <summary>
/// Accounts_User 的摘要说明。
/// </summary>
public class Accounts_User : OI.PageBase
{
protected System.Web.UI.WebControls.Label LabelUserName;
protected System.Web.UI.WebControls.Label LabelSex;
protected System.Web.UI.WebControls.Label LabelNationality;
protected System.Web.UI.WebControls.Label LabelNativePlace;
protected System.Web.UI.WebControls.Label LabelIsMarried;
protected System.Web.UI.WebControls.Label LabelPoliticalFeature;
protected System.Web.UI.WebControls.Label LabelSchool;
protected System.Web.UI.WebControls.Label LabelSpeciality;
protected System.Web.UI.WebControls.Label LabelIDCard;
protected System.Web.UI.WebControls.Label LabelPhoto;
protected System.Web.UI.WebControls.Label LabelDepartmentID;
protected System.Web.UI.WebControls.Label LabelProfessionalLevelID;
protected System.Web.UI.WebControls.Label LabelJobLevelID;
protected System.Web.UI.WebControls.Label LabelState;
protected System.Web.UI.WebControls.Label LabelTelephone;
protected System.Web.UI.WebControls.Label LabelMobile;
protected System.Web.UI.WebControls.Label LabelEmail;
protected System.Web.UI.WebControls.Label LabelZipCode;
protected System.Web.UI.WebControls.Label LabelContent;
protected System.Web.UI.WebControls.Label LabelUserID;
protected System.Web.UI.WebControls.Label LabelBirthday;
protected System.Web.UI.WebControls.Label LabelAddress;
protected System.Web.UI.WebControls.Label UnitName;
protected System.Web.UI.WebControls.ImageButton ImageButtonback;
private DatabaseConnect dc =new DatabaseConnect ();
public string displaySign;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if (Session["userid"]==null)
{
Response.Write ("<script>alert('超时,请重新登录');top.location.href='../userpass.aspx';</script>");
return ;
}
int intUserID=Convert.ToInt32 (Request.Params ["ID"]);
dc=new DatabaseConnect ();
string sql="select username,Sex,School,Speciality,IsMarried,Nationality,NativePlace,PoliticalFeature,IDCard,Birthday,Telephone,Mobile,Email,Address,State,Content,DepartmentName,[Description],ProfessionalLevelName ,Unitid,ZipCode from VIEWAccounts_Users where UserID="+intUserID+"";
DataSet ds=new DataSet();
ds=dc.getBinding(sql,"Accounts_User");
LabelUserName.Text =ds.Tables[0].Rows[0]["UserName"].ToString();
if(Convert.ToBoolean (ds.Tables[0].Rows[0]["Sex"]))
LabelSex.Text="男";
else
LabelSex.Text ="女";
LabelNationality.Text =ds.Tables[0].Rows[0]["Nationality"].ToString();
LabelNativePlace.Text =ds.Tables[0].Rows[0]["NativePlace"].ToString();
if (ds.Tables[0].Rows[0]["IsMarried"].ToString()=="0")
LabelIsMarried.Text="未婚";
else
LabelIsMarried.Text ="已婚";
LabelPoliticalFeature.Text =ds.Tables[0].Rows[0]["PoliticalFeature"].ToString();
LabelSchool.Text =ds.Tables[0].Rows[0]["School"].ToString();
LabelSpeciality.Text =ds.Tables[0].Rows[0]["Speciality"].ToString();
LabelIDCard.Text =ds.Tables[0].Rows[0]["IDCard"].ToString();
LabelDepartmentID.Text =ds.Tables[0].Rows[0]["DepartmentName"].ToString();
LabelProfessionalLevelID.Text=ds.Tables[0].Rows[0]["ProfessionalLevelName"].ToString();
LabelJobLevelID.Text =ds.Tables[0].Rows[0]["Description"].ToString();
if (Convert.ToBoolean(ds.Tables[0].Rows[0]["state"]))
LabelState.Text="<font color=red>离职</font>";
else
LabelState.Text ="在职";
LabelTelephone.Text =ds.Tables[0].Rows[0]["Telephone"].ToString();
LabelMobile.Text =ds.Tables[0].Rows[0]["Mobile"].ToString();
LabelEmail.Text =ds.Tables[0].Rows[0]["Email"].ToString();
LabelZipCode.Text =ds.Tables[0].Rows[0]["ZipCode"].ToString();
LabelAddress.Text =ds.Tables[0].Rows[0]["Address"].ToString();
LabelBirthday.Text =string.Format("{0:yyyy-MM-dd}",ds.Tables[0].Rows[0]["Birthday"]);
LabelContent.Text=ds.Tables[0].Rows[0]["Content"].ToString();
UnitName.Text=ds.Tables[0].Rows[0]["Unitid"].ToString();
Displayimg(intUserID.ToString ());
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.ImageButtonback.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButtonback_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void ImageButtonback_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
Response.Redirect("Accounts_Users.aspx");
}
public void Displayimg(string intUserID)
{
string sql="select personalsign from personalSign where UserID="+intUserID;
object o=dc.GetObjectBySql(sql);
if (o==null || o.ToString ()=="")
{
displaySign="";
}
else
{
displaySign="<img border=0 id=persionSign src=displayimg.aspx?id="+intUserID +">";
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -