public UsersExpModel GetUserModel(int UserID) { UsersExp exp = new UsersExp(); UsersExpModel model = new UsersExpModel(); return exp.GetUsersModel(UserID); }
public ActionResult AjaxUserInfo(int? UserID, string NickName) { Maticsoft.BLL.Members.Users users = new Maticsoft.BLL.Members.Users(); UsersExp exp = new UsersExp(); UsersExpModel usersModel = new UsersExpModel(); if (!string.IsNullOrEmpty(NickName)) { int userIdByNickName = users.GetUserIdByNickName(NickName); if (userIdByNickName <= 0) { return base.View("_AjaxUserInfo", usersModel); } UserID = new int?(userIdByNickName); } if (UserID.HasValue) { usersModel = exp.GetUsersModel(UserID.Value); string regionNameByRID = new Maticsoft.BLL.Ms.Regions().GetRegionNameByRID(Globals.SafeInt(usersModel.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("天津天津", "天津"); } usersModel.Address = string.IsNullOrEmpty(usersModel.Address) ? "暂未设置" : regionNameByRID; } Maticsoft.BLL.SNS.UserShip ship = new Maticsoft.BLL.SNS.UserShip(); if (base.currentUser != null) { if (base.currentUser.UserID == UserID.Value) { ((dynamic) base.ViewBag).IsSelf = true; } else if (ship.Exists(base.currentUser.UserID, UserID.Value)) { ((dynamic) base.ViewBag).IsFellow = true; } } return base.View("_AjaxUserInfo", usersModel); }