Exemplo n.º 1
0
        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 = "当前没有在线用户~~~";
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Random    rnd   = new Random();
            ArrayList alBmp = new ArrayList();
            ArrayList alUid = new ArrayList();
            DataTable dt;

            int intType   = Convert.ToInt32(Request.QueryString["Type"].ToString().Trim());
            int intUserID = Convert.ToInt32(Classlibrary.GetRequest("UserID", 0));

            if (intType < 0 || intType > 2 || !intType.Equals(intType))
            {
                intType = 1;
            }

            switch (intType)
            {
            case 1:
                int    intPage     = Convert.ToInt32(Request.QueryString["Page"].ToString().Trim());
                string strProvince = Request.QueryString["Province"].ToString().Trim();                     //省
                string strCity     = Request.QueryString["City"].ToString().Trim();                         //市
                int    intGender   = Convert.ToInt32(Request.QueryString["Gender"].ToString().Trim());      //性别 1男、0女、2全部
                int    intCategory = Convert.ToInt32(Request.QueryString["Category"].ToString().Trim());    //0 全部,1 小于15岁,2 16-22岁,3 23-30岁,4 31-40岁,5 大于40岁

                if (intPage < 0 || !intPage.Equals(intPage))
                {
                    intPage = 1;
                }

                dt = SqlLibrary.SearchUserList(intPage, strProvince, strCity, intGender, intCategory);
                DataTable dtConcernList = SqlLibrary.ReadConcernList(intUserID);
                if (dt != null)
                {
                    int i = 1;
                    foreach (DataRow dr in dt.Rows)
                    {
                        int      intUserIDT = (int)dr["UserId"];
                        DateTime dtnow      = DateTime.Now;
                        DateTime Birthday   = (DateTime)dr["Birthday"];
                        this.sb.Append("<div class=\"pic" + i + "\">");
                        if (Convert.ToString((bool)dr["Online"]) == "True")
                        {
                            this.sb.Append("<div class=\"headpic\"><a href=\"javascript:;\" onclick=\"ShowMsgBox(" + (int)dr["UserId"] + ",'" + (string)dr["NickName"].ToString().Trim() + "')\" title=\"昵称:" + (string)dr["NickName"].ToString() + "&#13;地区:" + (string)dr["Province"].ToString() + " " + (string)dr["City"].ToString() + "&#13;年龄:" + Convert.ToString(dtnow.Year - Birthday.Year) + "&#13;性别:" + (Convert.ToString((bool)dr["Sex"]) == "True" ? "男" : "女") + "\"><img src=\"http://ishow.xba.com.cn/image/" + (string)dr["Bmp"].ToString().Trim() + "?tmp=" + rnd.Next(000000, 999999).ToString() + "\" width=\"150\" height=\"130\" alt=\"昵称:" + (string)dr["NickName"].ToString() + "&#13;地区:" + (string)dr["Province"].ToString() + " " + (string)dr["City"].ToString() + "&#13;年龄:" + Convert.ToString(dtnow.Year - Birthday.Year) + "&#13;性别:" + (Convert.ToString((bool)dr["Sex"]) == "True" ? "男" : "女") + "\"/></a></div>");
                            //this.sb.Append("<div class=\"headpic\"><a href=\"#\" title='" + (string)dr["NickName"].ToString().Trim() + "'><img src=\"http://ishow.xba.com.cn/image/" + (string)dr["Bmp"].ToString().Trim() + "?tmp=" + rnd.Next(000000, 999999).ToString() + "\" width=\"150\" height=\"130\" alt='" + (string)dr["NickName"].ToString().Trim() + "' /></a></div>");
                        }
                        else
                        {
                            this.sb.Append("<div class=\"headpic\"><a href=\"javascript:;\" onclick=\"ShowMsgBox(" + (int)dr["UserId"] + ",'" + (string)dr["NickName"].ToString().Trim() + "')\" title=\"昵称:" + (string)dr["NickName"].ToString() + "&#13;地区:" + (string)dr["Province"].ToString() + " " + (string)dr["City"].ToString() + "&#13;年龄:" + Convert.ToString(dtnow.Year - Birthday.Year) + "&#13;性别:" + (Convert.ToString((bool)dr["Sex"]) == "True" ? "男" : "女") + "\"><img src=\"http://ishow.xba.com.cn/image/" + (string)dr["Bmp"].ToString().Trim() + "\" width=\"150\" height=\"130\" alt=\"昵称:" + (string)dr["NickName"].ToString() + "&#13;地区:" + (string)dr["Province"].ToString() + " " + (string)dr["City"].ToString() + "&#13;年龄:" + Convert.ToString(dtnow.Year - Birthday.Year) + "&#13;性别:" + (Convert.ToString((bool)dr["Sex"]) == "True" ? "男" : "女") + "\"/></a></div>");
                        }
                        this.sb.Append("<div class=\"show_text\">");
                        this.sb.Append("<div class=\"headname\"><a href=\"#\" title='" + (string)dr["NickName"].ToString().Trim() + "'>" + StringItem.StringTruncat((string)dr["NickName"].ToString().Trim(), 10, "...") + "</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>");
                        }
                        else
                        {
                            this.sb.Append("<div class=\"sms\"><a href=\"javascript:;\" onclick=\"ShowMsgBox(" + (int)dr["UserId"] + ",'" + (string)dr["NickName"].ToString().Trim() + "')\" ><img src=\"Images/pao.jpg\" alt=\"联系我\" 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=\"headadd\"><a href=\"javascript:;\" onclick=\"DeleteConcern(" + intUserID + "," + intUserIDT + ")\" ><img src=\"Images/cut.jpg\" alt=\"取消对该用户的关注\" onMouseOver='this.src=\"Images/cut_hover.jpg\"' onMouseOut='this.src=\"Images/cut.jpg\"' /></a></div>");
                            }
                            else
                            {
                                if (intUserID == intUserIDT)
                                {
                                    this.sb.Append("<div class=\"headadd\"></div>");
                                }
                                else
                                {
                                    this.sb.Append("<div class=\"headadd\"><a href=\"javascript:;\" onclick=\"AddConcern(" + intUserID + "," + intUserIDT + ")\" ><img src=\"Images/add.jpg\" alt=\"添加对该用户的关注\" 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=\"headadd\"></div>");
                            }
                            else
                            {
                                this.sb.Append("<div class=\"headadd\"><a href=\"javascript:;\" onclick=\"AddConcern(" + intUserID + "," + intUserIDT + ")\" ><img src=\"Images/add.jpg\" alt=\"添加对该用户的关注\" 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;

                    ////////////////////////////////////////////////
                    //if (intCount % 8 > 0)
                    //{
                    //    intCount = intCount / 8 + 1;
                    //}
                    //else
                    //{
                    //    intCount = intCount / 8;
                    //}
                    //this.strContent = "<script type=\"text/javascript\">SearchPage(" + intCount + ");</script>";
                    ////////////////////////////////////////////////

                    this.strContent = this.sb.ToString();
                    dt.Dispose();
                }
                else
                {
                    this.strContent = "当前没有满足查询条件的用户";
                }
                break;

            case 2:
                string strNickName = Server.UrlDecode(Request.QueryString["NickName"].ToString().Trim());

                dt            = SqlLibrary.SearchUser(strNickName);
                dtConcernList = SqlLibrary.ReadConcernList(intUserID);
                if (dt != null)
                {
                    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=\"150\" height=\"130\" /></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>");
                        }
                        else
                        {
                            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=\"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=\"headadd\"></div>");
                                }
                                else
                                {
                                    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=\"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=\"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 = "当前没有满足查询条件的用户";
                }
                break;
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            StringBuilder sb        = new StringBuilder();
            int           intType   = 0;
            int           intStatus = 0;

            intType = Convert.ToInt32(Classlibrary.GetRequest("Type", 0));

            if (!intType.Equals(intType) || intType > 0)
            {
                switch (intType)
                {
                case 1:     //修改密码
                    //@UserID int,
                    //@UserName varchar(50),
                    //@Password varchar(50),
                    //@NewPassword varchar(50)

                    int    intUserID      = Convert.ToInt32(Classlibrary.GetRequest("UserID", 0));
                    string strUserName    = Classlibrary.GetRequest("UserName", 1).ToString();
                    string strPassword    = Classlibrary.GetRequest("Password", 1).ToString();
                    string strNewPassword = Classlibrary.GetRequest("NewPassword", 1).ToString();

                    intStatus = SqlLibrary.ModifyPassword(intUserID, strUserName, strPassword, strNewPassword);
                    if (intStatus == 1)
                    {
                        sb.Append("{\"Status\":1}");        //修改成功
                        this.strContent = sb.ToString();
                    }
                    else
                    {
                        sb.Append("{\"Status\":0}");        //修改失败
                        this.strContent = sb.ToString();
                    }
                    break;

                case 2:     //修改用户信息
                    //@UserID int,
                    //@UserName varchar(50),
                    //@Password varchar(50),
                    //@BirthDay DateTime,
                    //@Province varchar(20),
                    //@City varchar(20),
                    //@QQ varchar(15)

                    intUserID   = Convert.ToInt32(Classlibrary.GetRequest("UserID", 0));
                    strUserName = Classlibrary.GetRequest("UserName", 1).ToString();
                    strPassword = Classlibrary.GetRequest("Password", 1).ToString();
                    DateTime dtBirthDay  = Convert.ToDateTime(Classlibrary.GetRequest("BirthDay", 1));
                    string   strProvince = Classlibrary.GetRequest("Province", 1).ToString();
                    string   strCity     = Classlibrary.GetRequest("City", 1).ToString();
                    string   strQQ       = Classlibrary.GetRequest("QQ", 1).ToString();

                    intStatus = SqlLibrary.ModifyUserInfo(intUserID, strUserName, strPassword, dtBirthDay, strProvince, strCity, strQQ);
                    if (intStatus == 1)
                    {
                        sb.Append("{\"Status\":1}");        //修改成功
                        this.strContent = sb.ToString();
                    }
                    else
                    {
                        sb.Append("{\"Status\":0}");        //修改失败
                        this.strContent = sb.ToString();
                    }
                    break;

                case 3:     //更新拍摄状态
                    //@UserID int,
                    //@UserName varchar(50),
                    //@Password varchar(50),
                    //@ShootStatus bit

                    intUserID   = Convert.ToInt32(Classlibrary.GetRequest("UserID", 0));
                    strUserName = Classlibrary.GetRequest("UserName", 1).ToString();
                    strPassword = Classlibrary.GetRequest("Password", 1).ToString();
                    bool blShootStatus = Convert.ToBoolean(Classlibrary.GetRequest("AutoShoot", 1).ToString());

                    intStatus = SqlLibrary.ModifyShootStatus(intUserID, strUserName, strPassword, blShootStatus);
                    if (intStatus == 1)
                    {
                        sb.Append("{\"Status\":1}");        //修改成功
                        this.strContent = sb.ToString();
                    }
                    else
                    {
                        sb.Append("{\"Status\":0}");        //修改失败
                        this.strContent = sb.ToString();
                    }
                    break;

                case 4:     //更新拍摄状态
                    //@UserID int,
                    //@UserName varchar(50),
                    //@Password varchar(50)

                    intUserID   = Convert.ToInt32(Classlibrary.GetRequest("UserID", 0));
                    strUserName = Classlibrary.GetRequest("UserName", 1).ToString();
                    strPassword = Classlibrary.GetRequest("Password", 1).ToString();

                    intStatus = SqlLibrary.UpdateOnlineTime(intUserID, strUserName, strPassword);
                    if (intStatus == 1)
                    {
                        sb.Append("{\"Status\":1}");        //修改成功
                        this.strContent = sb.ToString();
                    }
                    else
                    {
                        sb.Append("{\"Status\":0}");        //修改失败
                        this.strContent = sb.ToString();
                    }
                    break;
                }
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int           intType     = 0;
            string        strUserName = null;
            string        strPassword = null;
            StringBuilder sb          = new StringBuilder();

            intType = Convert.ToInt32(Classlibrary.GetRequest("Type", 0));

            if (!intType.Equals(intType) || intType > 0)
            {
                switch (intType)
                {
                case 1:     //用户登录验证
                    strUserName = Server.HtmlDecode(Classlibrary.GetRequest("UserName", 1).ToString());
                    strPassword = Server.HtmlDecode(Classlibrary.GetRequest("Password", 1).ToString());

                    DataRow dr = SqlLibrary.LoginAuth(strUserName, strPassword);
                    if (dr != null)
                    {
                        sb.Append("{\"UserID\":" + (int)dr["UserID"] + ",\"NickName\":\"" + (string)dr["NickName"] + "\",\"Sex\":\"" + (bool)dr["Sex"] + "\",\"LockTime\":" + (int)dr["LockTime"] + ",\"Status\":\"" + (bool)dr["Status"] + "\",\"Birthday\":\"" + (DateTime)dr["Birthday"] + "\",\"Province\":\"" + (string)dr["Province"] + "\",\"City\":\"" + (string)dr["City"] + "\",\"Tinyurl\":\"" + (string)dr["Tinyurl"] + "\",\"Headurl\":\"" + (string)dr["Headurl"] + "\",\"LastActiveTime\":\"" + (DateTime)dr["LastActiveTime"] + "\",\"QQ\":\"" + (string)dr["QQ"] + "\",\"VIP\":\"" + (bool)dr["VIP"] + "\"}");
                        SqlLibrary.SendQQMsg("182536608", "用户:" + (string)dr["NickName"] + " 登录");
                        this.strContent = sb.ToString();
                    }
                    else
                    {
                        this.strContent = "{\"UserID\":0}";
                    }
                    break;

                case 2:
                    int intUserID = Convert.ToInt32(Classlibrary.GetRequest("UserID", 2));

                    bool blVIP = SqlLibrary.CheckVIP(intUserID);
                    if (blVIP)
                    {
                        this.strContent = "{\"VIP\":1}";
                    }
                    else
                    {
                        this.strContent = "{\"VIP\":0}";
                    }
                    break;

                case 3:
                    strUserName = Server.HtmlDecode(Classlibrary.GetRequest("UserName", 1).ToString());
                    strPassword = Server.HtmlDecode(Classlibrary.GetRequest("Password", 1).ToString());

                    intType         = SqlLibrary.CheckUser(strUserName, strPassword);
                    this.strContent = "{\"Status\":" + intType + "}";
                    break;

                case 4:
                    intUserID = Convert.ToInt32(Classlibrary.GetRequest("UserID", 2));

                    long longTime = SqlLibrary.ReadOnlineTime(intUserID);
                    this.strContent = "{\"OnlineTime\":" + longTime + "}";
                    break;
                }
            }
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            StringBuilder sb           = new StringBuilder();
            int           intType      = 0;
            int           intUserID    = 0;
            int           intConcernID = 0;
            int           intStatus    = 0;
            int           intCount     = 0;

            intType = Convert.ToInt32(Classlibrary.GetRequest("Type", 0));

            if (!intType.Equals(intType) || intType > 0)
            {
                switch (intType)
                {
                case 1:     //添加关注
                    intUserID    = Convert.ToInt32(Classlibrary.GetRequest("UserID", 0));
                    intConcernID = Convert.ToInt32(Classlibrary.GetRequest("ConcernID", 0));
                    intStatus    = SqlLibrary.AddConcern(intUserID, intConcernID);

                    if (intStatus == 1)
                    {
                        sb.Append("{\"Status\":1}");        //添加成功
                        this.strContent = sb.ToString();
                    }
                    else if (intStatus == -1)
                    {
                        sb.Append("{\"Status\":-1}");        //添加失败,不是VIP
                        this.strContent = sb.ToString();
                    }
                    else
                    {
                        sb.Append("{\"Status\":0}");        //添加失败,关注已被添加
                        this.strContent = sb.ToString();
                    }
                    break;

                case 2:     //删除关注
                    intUserID    = Convert.ToInt32(Classlibrary.GetRequest("UserID", 0));
                    intConcernID = Convert.ToInt32(Classlibrary.GetRequest("ConcernID", 0));
                    intStatus    = SqlLibrary.DeleteConcern(intUserID, intConcernID);

                    if (intStatus == 1)
                    {
                        sb.Append("{\"Status\":1}");        //删除成功
                        this.strContent = sb.ToString();
                    }
                    else
                    {
                        sb.Append("{\"Status\":0}");        //删除失败,关注已被删除
                        this.strContent = sb.ToString();
                    }
                    break;

                case 3:     //统计关注数
                    intUserID = Convert.ToInt32(Classlibrary.GetRequest("UserID", 0));
                    intCount  = SqlLibrary.CountConcern(intUserID);
                    sb.Append("{\"Count\":" + intCount + "}");
                    this.strContent = sb.ToString();
                    break;

                case 4:     //统计粉丝数
                    intUserID = Convert.ToInt32(Classlibrary.GetRequest("UserID", 0));
                    intCount  = SqlLibrary.CountFans(intUserID);
                    sb.Append("{\"Count\":" + intCount + "}");
                    this.strContent = sb.ToString();
                    break;
                }
            }
        }
Exemplo n.º 6
0
        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;
                }
            }
        }