sharepoint获取当前登录人
/// <summary>
/// 当前登陆人组织情况
/// </summary>
public OrgEmployee CurEmployee
{
get
{
string login = SPContext.Current.Web.CurrentUser.LoginName.ToUpper();
login = login.Substring(login.IndexOf('\\') + 1);
return new OrgManage().GetEmployeeByLoginName(login);
}
}
/// <summary>
/// 得到登陆人的loginname
/// </summary>
public string CurShortLoginName
{
get
{
string login = SPContext.Current.Web.CurrentUser.LoginName.ToUpper();
return login.Substring(login.IndexOf('\\') + 1);
}
}
/// <summary>
/// 打开页面
/// </summary>
/// <param name="msg"></param>
public void ShowMessage(string msg)
{
this.ClientScript.RegisterStartupScript(this.GetType(), "msg",
String.Format("<script type=\"text/javascript\"> window.alert('{0}');</script>", msg.Replace("'", " ").Replace("\""," ")));
}