Beispiel #1
0
        public virtual void test_factory_nameUpper()
        {
            DayCount test = DayCount.of("BUS/252 EUTA");

            assertEquals(test.Name, "Bus/252 EUTA");
            assertEquals(test.ToString(), "Bus/252 EUTA");

            assertSame(DayCount.of("Bus/252 EUTA"), test);
            assertSame(DayCount.ofBus252(EUTA), test);
        }
Beispiel #2
0
        public virtual void test_factory_calendar()
        {
            DayCount test = DayCount.ofBus252(GBLO);

            assertEquals(test.Name, "Bus/252 GBLO");
            assertEquals(test.ToString(), "Bus/252 GBLO");

            assertSame(DayCount.of("Bus/252 GBLO"), test);
            assertSame(DayCount.ofBus252(GBLO), test);
        }
Beispiel #3
0
    protected void UserListInfo()
    {
        action  = Request["act"];              //高级搜索
        action1 = Request.QueryString["act1"]; //IP搜索
        action2 = Request.QueryString["act2"]; //登录ip搜索

        string userType  = CommonManager.Web.Request("usertype", "");
        string sortField = CommonManager.Web.Request("sortfield", "");
        string sortType  = CommonManager.Web.Request("sorttype", "");


        //排列方式
        switch (sortField)
        {
        case "id":
            sortField = "UserID";
            break;

        case "money":
            sortField = "SumMoney";
            break;

        case "vip": sortField = "VIPTime"; break;

        case "loginc": sortField = "AllLoginTime"; break;

        default:
            sortField = "RegisterTM";
            break;
        }
        if (string.IsNullOrEmpty(sortType))
        {
            sortType = "desc";
        }
        order = sortField + " " + sortType;

        if (action == "post")
        {
            #region 高级搜索;
            para += "act=post";
            string record = "", nickname = "", nicknameR = "", username = "", usernameR = "", grade = "", phone = "", logins = "", userid = "";
            string loginR = "", reg = "", regR = "", money = "", moneyR = "", score = "", scoreR = "";
            string zz = "", zr = "", tt = "", tr = "", ii = "";

            record    = Request.QueryString["d"];
            nickname  = Request.QueryString["n"];
            nicknameR = Request.QueryString["nr"];
            username  = Request.QueryString["u"];
            usernameR = Request.QueryString["ur"];
            userid    = Request.QueryString["id"];
            grade     = Request.QueryString["g"];
            phone     = Request.QueryString["e"];

            logins = Request.QueryString["l"];
            loginR = Request.QueryString["lr"];
            reg    = Request.QueryString["r"];
            regR   = Request.QueryString["rr"];
            money  = Request.QueryString["m"];
            moneyR = Request.QueryString["mr"];

            score  = Request.QueryString["s"];
            scoreR = Request.QueryString["sr"];
            zz     = Request.QueryString["z"];
            zr     = Request.QueryString["zr"];
            tt     = Request.QueryString["t"];
            tr     = Request.QueryString["tr"];
            ii     = Request.QueryString["i"];

            if (nicknameR == null)
            {
                nicknameR = "0";
            }
            if (usernameR == null)
            {
                usernameR = "0";
            }


            //判断最多显示记录数

            /*if( record != "" )
             * {//Limit.outMsgBox( "最多显示记录数的值无效,必须为有效的数字!", true );
             *      if( !CommonManager.String.IsInteger( record ) )
             *      {
             *              CommonManager.Web.RegJs(this, "alert('最多显示记录数的值无效,必须为有效的数字!');history.back();", false);
             *              return;
             *      }
             *      else
             *              searchtop = Convert.ToInt32( record );
             *      para += "&d=" + record;
             * }*/

            //判断用户昵称
            if (nickname != "")
            {
                if (Convert.ToInt32(nicknameR) == 1)
                {
                    sqladd = sqladd + " and nickname='" + nickname + "' ";
                }
                else
                {
                    sqladd = sqladd + " and nickname like '%" + nickname + "%' ";
                }
                para += "&n=" + Server.UrlEncode(nickname) + "&nr=" + nicknameR;
            }

            //判断用户名
            if (username != "")
            {
                if (Convert.ToInt32(usernameR) == 1)
                {
                    sqladd = sqladd + " and username='******' ";
                }
                else
                {
                    sqladd = sqladd + " and username like '%" + username + "%' ";
                }
                para += "&u=" + Server.UrlEncode(username) + "&ur=" + usernameR;
            }

            //判断用户等级
            //if(string.IsNullOrEmpty(grade))
            //{
            //    if (Convert.ToInt32(grade) < 100)
            //    {
            //        //if (Convert.ToInt32(grade) == 5) sqladd = sqladd + " and member>=5 ";
            //        //else
            //        sqladd = sqladd + " and TUserInfo.member=" + grade + "";
            //        para += "&g=" + grade;
            //    }
            //}

            //判断ID
            if (userid != "")
            {
                if (!CommonManager.String.IsInteger(userid))
                {
                    CommonManager.Web.RegJs(this, "alert('用户ID只能为数字!');history.back();", false);
                    return;
                }
                sqladd = sqladd + " and UserID='" + userid + "'";
            }

            //判断电话
            if (phone != "")
            {
                sqladd = sqladd + " and Phone like '%" + phone + "%' ";
                para  += "&e=" + Server.UrlEncode(phone);
            }

            //判断登录次数
            if (logins != "")
            {
                if (!CommonManager.String.IsInteger(logins))
                {
                    CommonManager.Web.RegJs(this, "alert('登录次数只能为数字!');history.back();", false);
                    return;
                }
                if (Convert.ToInt32(loginR) == 1)
                {
                    sqladd = sqladd + " and allLoginTime>=" + logins + "";
                }
                else
                {
                    sqladd = sqladd + " and allLoginTime<=" + logins + "";
                }

                para += "&l=" + logins + "&lr=" + loginR;
            }

            //判断注册天数
            if (reg != "")
            {
                if (!CommonManager.String.IsInteger(reg))
                {
                    CommonManager.Web.RegJs(this, "alert('注册天数只能为数字!');history.back();", false);
                    return;
                }
                if (Convert.ToInt32(regR) == 1)
                {
                    sqladd = sqladd + " and datediff(day, RegisterTM,getdate())>=" + reg + "";
                }
                else
                {
                    sqladd = sqladd + " and datediff(day,RegisterTM,getdate())<=" + reg + "";
                }
                para += "&r=" + reg + "&rr=" + regR;
            }
            Int64 mo;
            //判断用户金币数
            if (money != "")
            {
                if (!Int64.TryParse(money, out mo))
                {
                    CommonManager.Web.RegJs(this, "alert('用户金币数只能为数字!');history.back();", false);
                    return;
                }
                if (Convert.ToInt32(moneyR) == 1)
                {
                    sqladd = sqladd + " and (convert(bigint,WalletMoney)+convert(bigint,BankMoney))>=" + money + "";
                }
                else
                {
                    sqladd = sqladd + " and (convert(bigint,WalletMoney)+convert(bigint,BankMoney))<=" + money + "";
                }
                para += "&m=" + money + "&mr=" + moneyR;
            }

            ////判断用户积分数
            //if (score != "")
            //{
            //    if (!Limit.IsNumber(score)) Limit.outMsgBox("温馨提示:\\n\\n 用户积分数只能为数字!", true);
            //    if (Convert.ToInt32(scoreR) == 1) sqladd = sqladd + " and fen>=" + score + "";
            //    else sqladd = sqladd + " and fen<=" + score + "";
            //    para += "&s=" + score + "&sr=" + scoreR;
            //}

            //判断用户最后登录天数
            if (zz != "")
            {
                if (!CommonManager.String.IsInteger(zz))
                {
                    CommonManager.Web.RegJs(this, "alert('用户最后登录天数只能为数字!');history.back();", false);
                    return;
                }
                if (Convert.ToInt32(zr) == 1)
                {
                    sqladd = sqladd + " and datediff(day,LastLoginTM,getdate())>=" + zz + "";
                }
                else
                {
                    sqladd = sqladd + " and datediff(day,LastLoginTM,getdate())<=" + zz + "";
                }
                para += "&z=" + zz + "&zr=" + zr;
            }

            //判断用户交税总数
            if (tt != "")
            {
                if (!CommonManager.String.IsInteger(tt))
                {
                    CommonManager.Web.RegJs(this, "alert('用户交税总数只能为数字!');history.back();", false);
                    return;
                }

                if (Convert.ToInt32(tr) == 1)
                {
                    //sqladd = sqladd + " and taxCom>=" + tt + "";
                    sqladd = sqladd + "and (select sum(ChangeTax) from TChangeRecordUser as a where a.userid=Web_VUsersList.UserID)>=" + tt + "";
                }
                else
                {
                    //sqladd = sqladd + " and taxCom<=" + tt + "";
                    sqladd = sqladd + "and (select sum(ChangeTax) from TChangeRecordUser as a where a.userid=Web_VUsersList.UserID)<=" + tt + "";
                }
                para += "&t=" + tt;
            }

            // 限制登录大厅
            if (ii != null && ii.ToString().Length > 0)
            {
                sqladd = sqladd + " and Disabled=" + ii;
            }
            if (sqladd != "")
            {
                Sqlwhere     = "and userid>=0 " + sqladd;
                SqlUserCount = Sqlwhere;
                //Response.Write(Sqlwhere + "<br><br>");
                //Response.End();
            }
            #endregion
        }
        else if (action1 == "post1")
        {
            #region IP搜索
            //para += "act1=post1";
            string beginTime, EndTime, IPS, DayCount;
            beginTime = Request.QueryString["bt"];
            EndTime   = Request.QueryString["et"];
            EndTime  += DateTime.Now.ToString(" HH:mm:ss");              //结束时间为当前时间,如"2009-04-24 17:25:30"
            IPS       = CommonManager.Web.RequestUrlDecode("IP", "");    //Limit.editCharacter(Request.QueryString["IP"]);

            DayCount = Request.QueryString["dc"];

            if (DayCount == null || DayCount.ToString() == "")
            {
                DayCount = "0";
            }

            if (DayCount == "1")
            {
                Response.Redirect("CountIp.aspx?tt=" + beginTime + "&nn=" + EndTime + "&dd=" + DayCount + "&ip=" + IPS);
            }
            else
            {
                sqladd = sqladd + "and  Convert(datetime,RegisterTM)>='" + beginTime + "' and  Convert(datetime,RegisterTM)<='" + EndTime + "'";
                if (!string.IsNullOrEmpty(IPS))
                {
                    sqladd = sqladd + " and RegisterIP='" + IPS + "'";
                }

                Sqlwhere     = sqladd;
                SqlUserCount = sqladd;

                para = "act1=post1&bt=" + beginTime + "&et=" + EndTime + "&dc=" + DayCount + "&IP=" + IPS;
            }
            #endregion
        }

        else if (action2 == "post2")
        {
            #region 登录IP搜索
            string begintime, endtime, ip;
            begintime = Request.QueryString["bt"];
            endtime   = Request.QueryString["et"];
            endtime  += DateTime.Now.ToString(" HH:mm:ss");              //结束时间为当前时间,如"2009-04-24 17:25:30"
            ip        = CommonManager.Web.RequestUrlDecode("ip", "");    //Limit.editCharacter(Request.QueryString["ip"]);
            sqladd    = sqladd + "and Convert(datetime,LastLoginTM)>='" + begintime + "' and Convert(datetime,LastLoginTM)<='" + endtime + "' and lastLoginIp='" + ip + "'";
            Sqlwhere  = sqladd;


            SqlUserCount = sqladd;
            para         = "act2=post2&bt=" + begintime + "&et=" + endtime + "&IP=" + ip + "";
            #endregion
        }
        else if (!string.IsNullOrEmpty(Request.QueryString["userid"]))
        {
            UserID   = Request.QueryString["userid"];
            Sqlwhere = Sqlwhere + "and userid=" + UserID;
        }
        else
        {
            #region 分类显示
            //UserListTypesID = Limit.getFormValue( "id" );
            UserListTypesID = Request.QueryString["id"];
            if (UserListTypesID != null && UserListTypesID.ToString() == "1")                   //1 ==  今日注册用户
            {
                Sqlwhere      = "and datediff(day,RegisterTM,getdate())=0 ";
                SqlUserCount  = "and datediff(day,RegisterTM,getdate())=0 ";
                UserListTitle = "今日注册用户";
                para          = "id=" + UserListTypesID + "";
            }
            else if (UserListTypesID != null && UserListTypesID.ToString() == "2")               //2 == 24小时注册用户
            {
                Sqlwhere      = "and datediff(hour,RegisterTM,getdate())<=24 ";
                SqlUserCount  = "and datediff(hour,RegisterTM,getdate())<=24 ";
                UserListTitle = "24小时注册用户";
                para          = "id=" + UserListTypesID + "";
            }
            else if (UserListTypesID != null && UserListTypesID.ToString() == "3")              //3 == 24小时登录用户
            {
                Sqlwhere      = "and datediff(hour,LastLoginTM,getdate())<=24 ";
                SqlUserCount  = "and datediff(hour,LastLoginTM,getdate())<=24 ";
                UserListTitle = "24小时登录用户";
                para          = "id=" + UserListTypesID + "";
            }
            else
            {
                Sqlwhere      = "";
                SqlUserCount  = "";
                UserListTitle = "所有用户列表";
                para          = "";
            }

            #endregion
        }
        //用户类型
        if (userType == "all")
        {
            SqlUserCount  = "";
            UserListTitle = "所有玩家列表";
            para          = "";
        }
        else if (userType == "robotplayer")
        {
            Sqlwhere     += "and IsRobot=1";
            SqlUserCount  = "";
            UserListTitle = "机器人列表";
            para          = "";
        }
        else
        {
            Sqlwhere     += "and IsRobot=0";
            SqlUserCount  = "";
            UserListTitle = "真实玩家列表";
        }



        DataTable sd = new DataTable();

        string[] sql    = new string[2];
        string   topSQL = "";
        if (searchtop > 0)
        {
            topSQL = " top " + searchtop;
        }

        DataSet ds = DbSession.Default.FromProc("Web_pGetDataPager")
                     .AddInputParameter("@PageSize", DbType.Int32, anpPageIndex.PageSize)
                     .AddInputParameter("@CurrentPage", DbType.Int32, PageIndex)
                     .AddInputParameter("@Columns", DbType.String, "*")
                     .AddInputParameter("@TableName", DbType.String, "Web_VUsersList")
                     .AddInputParameter("@Wheres", DbType.String, " " + Sqlwhere)
                     .AddInputParameter("@KeyName", DbType.String, "UserID")
                     .AddInputParameter("@OrderBy", DbType.String, order)
                     .ToDataSet();
        if (ds.Tables.Count > 0 && ds.Tables[1].Rows.Count > 0)
        {
            anpPageIndex.RecordCount      = (int)ds.Tables[0].Rows[0][0];
            anpPageIndex.CurrentPageIndex = PageIndex;

            UserList.DataSource = ds.Tables[1];
            UserList.DataBind();
            UserList.Visible   = true;
            NoUserList.Visible = false;
        }
        else
        {
            this.NoUserList.Visible = true;
            UserList.Visible        = false;
        }
    }