/// <summary> /// 显示当前用户 /// </summary> /// <returns></returns> public string UserShow() { ProductTypeBLL ptb = new ProductTypeBLL(); string userName = userInfo.User.userName; DataTable dtPersion = ptb.GetPersonaIdByUserName(userName); //通过当前用户查找当前用户所属角色 string Name = dtPersion.Rows[0][1].ToString(); //用户名 string persionName = ptb.GetPersionNameByid(dtPersion.Rows[0][0].ToString()); int thistime = DateTime.Now.Hour; string greeting = ""; if (thistime > 0 && thistime < 12) { greeting = "上午好!@_@"; } else { greeting = "下午好!@_@"; } return(userName + "❤" + Name + "❤" + persionName + "❤" + greeting); }