public static DataRow GetUserRowByUserNamePWD(string strUserName, string strPassword) { SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("UserName", SqlDbType.VarChar), new SqlParameter("Password", SqlDbType.VarChar) }; commandParameters[0].Value = strUserName; commandParameters[1].Value = strPassword; return(SqlHelper.ExecuteDataRow(SqlLibrary.GetServer_Main(), CommandType.StoredProcedure, "GetUserRowByUserNamePWD", commandParameters)); }
/// <summary> /// 读取用户信息和图片信息 /// </summary> /// <param name="intUserID"></param> /// <returns></returns> public static DataRow ReadUserInfoAndImg(int intUserID) { SqlParameter[] sp = new SqlParameter[1]; sp[0] = new SqlParameter("@UserID", SqlDbType.Int); sp[0].Value = intUserID; DataRow dr = SqlHelper.ExecuteDataRow(SqlLibrary.GetServer_Main(), CommandType.StoredProcedure, "ReadUserInfoAndImg", sp); return(dr); }
/// <summary> /// 搜索用户列表(精确) /// </summary> /// <param name="strNickName"></param> /// <returns></returns> public static DataTable SearchUser(string strNickName) { SqlParameter[] sp = new SqlParameter[1]; sp[0] = new SqlParameter("@NickName", SqlDbType.VarChar, 50); sp[0].Value = strNickName; DataTable dt = SqlHelper.ExecuteDataTable(SqlLibrary.GetServer_Main(), CommandType.StoredProcedure, "SearchUser", sp); return(dt); }
protected void Page_Load(object sender, EventArgs e) { string strSQL = "SELECT COUNT(*) AS Count FROM MT_User WITH(NOLOCK)"; DataRow dr = SqlHelper.ExecuteDataRow(SqlLibrary.GetServer_Main(), CommandType.Text, strSQL); intCount = (int)dr["Count"]; strSQL = "SELECT COUNT(*) AS Count FROM MT_Media WITH(NOLOCK) WHERE OnLine = 1"; dr = SqlHelper.ExecuteDataRow(SqlLibrary.GetServer_Main(), CommandType.Text, strSQL); intOnlineCount = (int)dr["Count"]; }
public static SqlDataReader RegisterUser(string strUserName, string strPassword, string strNickName, int intSex, string strBirthDay, string strPro, string strCity, string strQQ) { SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("UserName", SqlDbType.VarChar), new SqlParameter("Password", SqlDbType.VarChar), new SqlParameter("NickName", SqlDbType.VarChar), new SqlParameter("Sex", SqlDbType.Bit), new SqlParameter("BirthDay", SqlDbType.DateTime), new SqlParameter("Province", SqlDbType.VarChar), new SqlParameter("City", SqlDbType.VarChar), new SqlParameter("QQ", SqlDbType.VarChar) }; commandParameters[0].Value = strUserName; commandParameters[1].Value = strPassword; commandParameters[2].Value = strNickName; commandParameters[3].Value = intSex; commandParameters[4].Value = strBirthDay; commandParameters[5].Value = strPro; commandParameters[6].Value = strCity; commandParameters[7].Value = strQQ; return(SqlHelper.ExecuteReader(SqlLibrary.GetServer_Main(), CommandType.StoredProcedure, "RegisterUser", commandParameters)); }
/// <summary> /// 搜索用户列表(模糊) /// </summary> /// <param name="intPage"></param> /// <param name="strProvince"></param> /// <param name="strCity"></param> /// <param name="intGender"></param> /// <param name="intCategory"></param> /// <returns></returns> public static DataTable SearchUserList(int intPage, string strProvince, string strCity, int intGender, int intCategory) { SqlParameter[] sp = new SqlParameter[6]; sp[0] = new SqlParameter("@PageIndex", SqlDbType.Int, 4); sp[1] = new SqlParameter("@PageSize", SqlDbType.Int, 4); sp[2] = new SqlParameter("@Province", SqlDbType.VarChar, 20); sp[3] = new SqlParameter("@City", SqlDbType.VarChar, 20); sp[4] = new SqlParameter("@Gender", SqlDbType.Int, 1); sp[5] = new SqlParameter("@Category", SqlDbType.Int, 1); sp[0].Value = intPage; sp[1].Value = 8; sp[2].Value = strProvince; sp[3].Value = strCity; sp[4].Value = intGender; sp[5].Value = intCategory; DataTable dt = SqlHelper.ExecuteDataTable(SqlLibrary.GetServer_Main(), CommandType.StoredProcedure, "SearchUserList", sp); return(dt); }
protected void Page_Load(object sender, EventArgs e) { Random rnd = new Random(); ArrayList alBmp = new ArrayList(); ArrayList alUid = new ArrayList(); int intUserID = 0; int intType = 0; intUserID = Convert.ToInt32(Classlibrary.GetRequest("UserID", 0)); intType = Convert.ToInt32(Classlibrary.GetRequest("Type", 0)); if (intUserID > 0) { Session["UserID"] = intUserID; this.strUserID = intUserID.ToString(); } else { Response.Redirect("Logins.aspx"); return; } if (intType > 0) { this.strContent = "<script type='text/javascript'>ShowConcern();</script>"; return; } this.strCMD = "<script type='text/javascript'>Timer1();</script>"; int intPage = 1; if (Request.QueryString["Page"] != null) { intPage = Convert.ToInt32(Request.QueryString["Page"].ToString()); } if (intPage < 0 || !intPage.Equals(intPage)) { intPage = 1; } SqlParameter[] sp = new SqlParameter[2]; sp[0] = new SqlParameter("@PageIndex", SqlDbType.Int, 4); sp[1] = new SqlParameter("@PageSize", SqlDbType.Int, 4); sp[0].Value = intPage; sp[1].Value = 8; DataTable dt = SqlHelper.ExecuteDataTable(SqlLibrary.GetServer_Main(), CommandType.StoredProcedure, "Xn_GetShowList", sp); DataTable dtConcernList = SqlLibrary.ReadConcernList(intUserID); if (dt != null) { string strSQL = "SELECT ISNULL(Count(id),0) AS Count FROM [MT_Media]"; this.intPageSize = Convert.ToInt32(SqlHelper.ExecuteScalar(SqlLibrary.GetServer_Main(), CommandType.Text, strSQL)); if (this.intPageSize % 8 > 0) { this.intPageSize = this.intPageSize / 8 + 1; } else { this.intPageSize = this.intPageSize / 8; } int i = 1; foreach (DataRow dr in dt.Rows) { int intUserIDT = (int)dr["UserId"]; //this.sb.Append("<div class=\"pic" + i + "\">"); //this.sb.Append("<div class=\"headpic\"><a href=\"#\"><img src=\"http://ishow.xba.com.cn/image/" + (string)dr["Bmp"].ToString().Trim() + "?tmp=" + rnd.Next(000000, 999999).ToString() + "\" width=\"149\" height=\"115\" /></a></div>"); //this.sb.Append("<div class=\"headname\"><a href=\"#\">" + (string)dr["NickName"].ToString().Trim() + "</a></div>"); //this.sb.Append("<div class=\"headtime\">" + StringItem.FormatDate((DateTime)dr["CreateTime"], "hh:mm") + "</div>"); this.sb.Append("<div class=\"pic" + i + "\">"); this.sb.Append("<div class=\"headpic\"><a href=\"javascript:;\" title='" + (string)dr["NickName"].ToString().Trim() + "' onclick=\"ShowMsgBox(" + (int)dr["UserId"] + ",'" + (string)dr["NickName"].ToString().Trim() + "')\" ><img src=\"http://ishow.xba.com.cn/image/" + (string)dr["Bmp"].ToString().Trim() + "?tmp=" + rnd.Next(000000, 999999).ToString() + "\" /></a></div>"); this.sb.Append("<div class=\"show_text\">"); this.sb.Append("<div class=\"headname\"><a href=\"#\">" + (string)dr["NickName"].ToString().Trim() + "</a></div>"); this.sb.Append("<div class=\"headtime\">" + StringItem.FormatDate((DateTime)dr["CreateTime"], "hh:mm") + "</div>"); if (intUserID == intUserIDT) { //this.sb.Append("<div class=\"sms\">*</div>"); this.sb.Append("<div class=\"sms\"><img src=\"Images/pao.jpg\" onMouseOver='this.src=\"Images/pao_hover.jpg\"' onMouseOut='this.src=\"Images/pao.jpg\"'></div>"); } else { //this.sb.Append("<div class=\"sms\"><a href=\"javascript:;\" onclick=\"ShowMsgBox(" + (int)dr["UserId"] + ",'" + (string)dr["NickName"].ToString().Trim() + "')\" >M</a></div>"); this.sb.Append("<div class=\"sms\"><a href=\"javascript:;\" onclick=\"ShowMsgBox(" + (int)dr["UserId"] + ",'" + (string)dr["NickName"].ToString().Trim() + "')\" ><img src=\"Images/pao.jpg\" onMouseOver='this.src=\"Images/pao_hover.jpg\"' onMouseOut='this.src=\"Images/pao.jpg\"'></a></div>"); } if (dtConcernList != null) { DataRow[] drs = dtConcernList.Select("ConcernID=" + intUserIDT); if (drs != null && drs.Length > 0) { //this.sb.Append("<div class=\"concern\"><a href=\"javascript:;\" onclick=\"DeleteConcern(" + intUserID + "," + intUserIDT + ")\" >-</a></div>"); this.sb.Append("<div class=\"headadd\"><a href=\"javascript:;\" onclick=\"DeleteConcern(" + intUserID + "," + intUserIDT + ")\" ><img src=\"Images/cut.jpg\" onMouseOver='this.src=\"Images/cut_hover.jpg\"' onMouseOut='this.src=\"Images/cut.jpg\"'></a></div>"); } else { if (intUserID == intUserIDT) { //this.sb.Append("<div class=\"concern\">*</div>"); this.sb.Append("<div class=\"headadd\"><img src=\"Images/add.jpg\" onMouseOver='this.src=\"Images/add_hover.jpg\"' onMouseOut='this.src=\"Images/add.jpg\"'></div>"); } else { //this.sb.Append("<div class=\"concern\"><a href=\"javascript:;\" onclick=\"AddConcern(" + intUserID + "," + intUserIDT + ")\" >+</a></div>"); this.sb.Append("<div class=\"headadd\"><a href=\"javascript:;\" onclick=\"AddConcern(" + intUserID + "," + intUserIDT + ")\" ><img src=\"Images/add.jpg\" onMouseOver='this.src=\"Images/add_hover.jpg\"' onMouseOut='this.src=\"Images/add.jpg\"'></a></div>"); } } dtConcernList.Dispose(); } else { if (intUserID == intUserIDT) { //this.sb.Append("<div class=\"concern\">*</div>"); this.sb.Append("<div class=\"headadd\"><img src=\"Images/add.jpg\" onMouseOver='this.src=\"Images/add_hover.jpg\"' onMouseOut='this.src=\"Images/add.jpg\"'></div>"); } else { //this.sb.Append("<div class=\"concern\"><a href=\"javascript:;\" onclick=\"AddConcern(" + intUserID + "," + intUserIDT + ")\" >+</a></div>"); this.sb.Append("<div class=\"headadd\"><a href=\"javascript:;\" onclick=\"AddConcern(" + intUserID + "," + intUserIDT + ")\" ><img src=\"Images/add.jpg\" onMouseOver='this.src=\"Images/add_hover.jpg\"' onMouseOut='this.src=\"Images/add.jpg\"'></a></div>"); } } this.sb.Append("</div>\r\n"); this.sb.Append("</div>\r\n"); i++; } //ShowImg.Visible = true; this.strContent = this.sb.ToString(); dt.Dispose(); } else { this.strContent = "当前没有在线用户~~~"; } }
public static bool HasUserName(string strUserName) { SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("UserName", SqlDbType.VarChar) }; commandParameters[0].Value = strUserName; return(Convert.ToBoolean(SqlHelper.ExecuteScalar(SqlLibrary.GetServer_Main(), CommandType.StoredProcedure, "HasUserName", commandParameters))); }
public static DataRow GetMainParameterRow() { return(SqlHelper.ExecuteDataRow(SqlLibrary.GetServer_Main(), CommandType.StoredProcedure, "GetMainParameterRow")); }
protected void Page_Load(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); int intType = 0; int intCount = 0; int intUserID = 0; string strSQL = null; string strProvince = null; string strCity = null; string strGender = null; string strCategory = null; intType = Convert.ToInt32(Classlibrary.GetRequest("Type", 0)); if (!intType.Equals(intType) || intType > 0) { switch (intType) { case 1: //大厅分页 strSQL = "SELECT ISNULL(Count(id),1) AS Count FROM [MT_Media] WITH(NOLOCK)"; intCount = Convert.ToInt32(SqlHelper.ExecuteScalar(SqlLibrary.GetServer_Main(), CommandType.Text, strSQL)); if (intCount % 8 > 0) { intCount = intCount / 8 + 1; } else { intCount = intCount / 8; } this.strContent = "{\"Page\":" + intCount + "}"; break; case 2: //关注分页 intUserID = Convert.ToInt32(Classlibrary.GetRequest("UserID", 1)); //intUserID = Convert.ToInt32(Session["UserID"]); DataTable dt = SqlLibrary.ReadConcernList(intUserID); if (dt != null) { intCount = dt.Rows.Count; if (intCount % 8 > 0) { intCount = intCount / 8 + 1; } else { intCount = intCount / 8; } this.strContent = "{\"Page\":" + intCount + "}"; } else { this.strContent = "{\"Page\":0}"; } break; case 3: //粉丝分页 intUserID = Convert.ToInt32(Classlibrary.GetRequest("UserID", 1)); intCount = SqlLibrary.CountFans(intUserID); if (intCount > 0) { if (intCount % 8 > 0) { intCount = intCount / 8 + 1; } else { intCount = intCount / 8; } this.strContent = "{\"Page\":" + intCount + "}"; } else { this.strContent = "{\"Page\":0}"; } break; case 4: //搜索分页 strProvince = Classlibrary.GetRequest("Province", 1).ToString(); strCity = Classlibrary.GetRequest("City", 1).ToString(); strGender = Classlibrary.GetRequest("Gender", 1).ToString(); strCategory = Classlibrary.GetRequest("Category", 1).ToString(); intCount = SqlLibrary.SearchUserListCount(strProvince, strCity, strGender, strCategory); if (intCount > 0) { if (intCount % 8 > 0) { intCount = intCount / 8 + 1; } else { intCount = intCount / 8; } this.strContent = "{\"Page\":" + intCount + "}"; } else { this.strContent = "{\"Page\":0}"; } break; } } }