private void ShowInfo(int ID) { AccountsPrincipal existingPrincipal = new AccountsPrincipal(ID); User user = new User(existingPrincipal); UsersExpModel usersExpModel = new UsersExp().GetUsersExpModel(ID); if ((user != null) && (usersExpModel != null)) { this.lblUserName.Text = user.UserName; this.lblTrueName.Text = user.TrueName; this.lblPhone.Text = user.Phone; this.lblNickName.Text = user.NickName; this.lblEmail.Text = user.Email; this.lblAblums.Text = usersExpModel.AblumsCount.ToString(); this.lblFans.Text = usersExpModel.FansCount.ToString(); this.lblFav.Text = usersExpModel.FavouritesCount.ToString(); this.lblFellows.Text = usersExpModel.FellowCount.ToString(); this.lblProducts.Text = usersExpModel.ProductsCount.ToString(); this.lblSex.Text = (!string.IsNullOrWhiteSpace(user.Sex) && (user.Sex.Trim() == "0")) ? "女" : "男"; this.lblActivity.Text = user.Activity ? "正常使用" : "已经冻结"; this.lblCreTime.Text = user.User_dateCreate.ToString("yyyy-MM-dd HH:mm:ss"); } if (usersExpModel != null) { Regions regions = new Regions(); this.imageGra.ImageUrl = string.Format("/Upload/User/Gravatar/{0}.jpg", usersExpModel.UserID); string regionNameByRID = regions.GetRegionNameByRID(Globals.SafeInt(usersExpModel.Address, 0)); if (regionNameByRID.Contains("北京北京")) { regionNameByRID = regionNameByRID.Replace("北京北京", "北京"); } else if (regionNameByRID.Contains("上海上海")) { regionNameByRID = regionNameByRID.Replace("上海上海", "上海"); } else if (regionNameByRID.Contains("重庆重庆")) { regionNameByRID = regionNameByRID.Replace("重庆重庆", "重庆"); } else if (regionNameByRID.Contains("天津天津")) { regionNameByRID = regionNameByRID.Replace("天津天津", "天津"); } this.lblAddress.Text = string.IsNullOrEmpty(usersExpModel.Address) ? "暂未设置" : regionNameByRID; this.lblPoints.Text = usersExpModel.Points.ToString(); this.lblLoginDate.Text = usersExpModel.LastLoginTime.ToString("yyyy-MM-dd HH:mm:ss"); } }