public CommentUser GetCommentUser(string UserID) { var row = commentDal.GetCommentUser(SqlConnectionOpen, UserID); if (row == null) { return(new CommentUser()); } else { string uName = !string.IsNullOrEmpty(row["u_Pref5"].ToString()) ? row["u_Pref5"].ToString() : row["u_last_name"].ToString(); if (string.IsNullOrEmpty(uName)) { string phone = row["u_mobile_number"].ToString(); uName = phone.Replace(phone.Substring(3, 4), "****"); } return(new CommentUser() { UserID = row["UserID"].ToString(), UserName = uName, UserHead = !string.IsNullOrEmpty(row["u_Imagefile"].ToString()) ? System.Configuration.ConfigurationManager.AppSettings["DoMain_image"] + row["u_Imagefile"].ToString() : "http://resource.tuhu.cn/Image/Product/zhilaohu.png", UserPhone = row["u_mobile_number"].ToString() }); } }