Example #1
0
	///<summary>
	/// Creates a PLN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PLN(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"ID Number");
		data[1] = new IS(message, 338,"Type of ID Number");
		data[2] = new ST(message,"State/other Qualifying Information");
		data[3] = new DT(message,"Expiration Date");
	}
Example #2
0
	///<summary>
	/// Creates a CM_PIP.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CM_PIP(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new CE(message,"Privilege");
		data[1] = new CE(message,"Privilege class");
		data[2] = new DT(message,"Expiration date");
		data[3] = new DT(message,"Activation date");
	}
Example #3
0
	///<summary>
	/// Creates a PLN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PLN(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"ID number (ST)");
		data[1] = new IS(message, 0,"Type of ID number (IS)");
		data[2] = new ST(message,"State/other qualifying info");
		data[3] = new DT(message,"Expiration date");
	}
Example #4
0
 ///<summary>
 /// Creates a CM_OCD.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public CM_OCD(Message message, string description)
     : base(message, description)
 {
     data = new Type[2];
     data[0] = new ID(message, 0,"Occurrence code");
     data[1] = new DT(message,"Occurrence date");
 }
Example #5
0
    //Static methods
    /////////////////////////////// Implementation ////////////////////////////////
    public static double MeanGreenwichSiderealTime(double JD)
    {
        //Get the Julian day for the same day at midnight

          DT date = new DT();
          date.SetJD(JD, DT.AfterPapalReformJD(JD));
          double[] D = date.Get();

          int Year = (int)D[0];
          int Month = (int)D[1];
          int Day = (int)D[2];
          int Hour = (int)D[3];
          int Minute = (int)D[4];
          double Second = D[5];

          date.Set(Year, Month, Day, 0, 0, 0, date.InGregorianCalendar());
          double JDMidnight = date.Julian();

          //Calculate the sidereal time at midnight
          double T = (JDMidnight - 2451545) / 36525;
          double TSquared = T *T;
          double TCubed = TSquared *T;
          double Value = 100.46061837 + (36000.770053608 *T) + (0.000387933 *TSquared) - (TCubed/38710000);

          //Adjust by the time of day
          Value += (((Hour * 15) + (Minute * 0.25) + (Second * 0.0041666666666666666666666666666667)) * 1.00273790935);

          Value = CT.D2H(Value);

          return CT.M24(Value);
    }
Example #6
0
	///<summary>
	/// Creates a SPD.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public SPD(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"Specialty Name");
		data[1] = new ST(message,"Governing Board");
		data[2] = new ID(message, 337,"Eligible or Certified");
		data[3] = new DT(message,"Date of Certification");
	}
Example #7
0
	///<summary>
	/// Creates a CM_SPD.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CM_SPD(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"Specialty name");
		data[1] = new ST(message,"Governing board");
		data[2] = new ID(message, 0,"Eligible or certified");
		data[3] = new DT(message,"Date of certification");
	}
Example #8
0
File: OCD.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a OCD.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public OCD(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new CNE(message,"Occurrence Code");
     data[1] = new DT(message,"Occurrence Date");
 }
Example #9
0
File: OSP.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a OSP.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public OSP(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new CNE(message,"Occurrence Span Code");
     data[1] = new DT(message,"Occurrence Span Start Date");
     data[2] = new DT(message,"Occurrence Span Stop Date");
 }
Example #10
0
	///<summary>
	/// Creates a PIP.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PIP(IMessage message, string description) : base(message, description){
		data = new IType[5];
		data[0] = new CE(message,"Privilege");
		data[1] = new CE(message,"Privilege Class");
		data[2] = new DT(message,"Expiration Date");
		data[3] = new DT(message,"Activation Date");
		data[4] = new EI(message,"Facility");
	}
Example #11
0
 ///<summary>
 /// Creates a CM_OSP.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public CM_OSP(Message message, string description)
     : base(message, description)
 {
     data = new Type[3];
     data[0] = new ID(message, 0,"Occurrence span code");
     data[1] = new DT(message,"Occurrence span start date");
     data[2] = new DT(message,"Occurrence span stop date");
 }
Example #12
0
File: DLN.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a DLN.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public DLN(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new ST(message,"Driver´s License Number");
     data[1] = new IS(message, 0,"Issuing State, province, country");
     data[2] = new DT(message,"Expiration date");
 }
Example #13
0
File: DLN.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a DLN.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public DLN(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new ST(message,"License Number");
     data[1] = new IS(message, 333,"Issuing State, Province, Country");
     data[2] = new DT(message,"Expiration Date");
 }
Example #14
0
File: AUI.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a AUI.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public AUI(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new ST(message,"Authorization Number");
     data[1] = new DT(message,"Date");
     data[2] = new ST(message,"Source");
 }
Example #15
0
 public void Should_Parse_leap_year()
 {
     var date = new DT(2012, 2, 29);
     Assert.AreEqual("20120229", date.Value);
     Assert.AreEqual(2012, date.Year);
     Assert.AreEqual(2, date.Month);
     Assert.AreEqual(29, date.Day);
 }
Example #16
0
File: CX.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a CX.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CX(IMessage message, string description) : base(message, description){
		data = new IType[8];
		data[0] = new ST(message,"ID");
		data[1] = new ST(message,"Check digit (ST)");
		data[2] = new ID(message, 0,"Code identifying the check digit scheme employed");
		data[3] = new HD(message,"Assigning authority");
		data[4] = new ID(message, 203,"Identifier type code (ID)");
		data[5] = new HD(message,"Assigning facility");
		data[6] = new DT(message,"Effective date (DT)");
		data[7] = new DT(message,"Expiration date");
	}
Example #17
0
File: CX.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a CX.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CX(IMessage message, string description) : base(message, description){
		data = new IType[10];
		data[0] = new ST(message,"ID Number");
		data[1] = new ST(message,"Check Digit");
		data[2] = new ID(message, 61,"Check Digit Scheme");
		data[3] = new HD(message,"Assigning Authority");
		data[4] = new ID(message, 203,"Identifier Type Code");
		data[5] = new HD(message,"Assigning Facility");
		data[6] = new DT(message,"Effective Date");
		data[7] = new DT(message,"Expiration Date");
		data[8] = new CWE(message,"Assigning Jurisdiction");
		data[9] = new CWE(message,"Assigning Agency or Department");
	}
Example #18
0
    private void ViewPage()
    {
        int id    = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误"));
        int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[1-2]\d*$", "1"));

        BCW.Model.Game.Balllist model = new BCW.BLL.Game.Balllist().GetBalllist(id);
        if (model == null)
        {
            Utils.Error("不存在的记录", "");
        }
        Master.Title = "第" + id + "期疯狂彩球";
        builder.Append(Out.Tab("<div class=\"text\">", ""));
        builder.Append("查看下注/开奖记录");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"text\">", ""));
        builder.Append("查看:");
        if (ptype == 1)
        {
            builder.Append("下注|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=view&amp;ptype=1&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">下注</a>|");
        }

        if (ptype == 2)
        {
            builder.Append("中奖");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=view&amp;ptype=2&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">中奖</a>");
        }

        builder.Append(Out.Tab("</div>", "<br />"));

        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = string.Empty;

        if (ptype == 1)
        {
            strWhere += "BallId=" + id + "";
        }
        else
        {
            strWhere += "BallId=" + id + " and state>0 and winCent>0";
        }

        string[] pageValUrl = { "act", "id", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        // 开始读取列表
        IList <BCW.Model.Game.Ballpay> listBallpay = new BCW.BLL.Game.Ballpay().GetBallpays(pageIndex, pageSize, strWhere, out recordCount);

        if (listBallpay.Count > 0)
        {
            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("第" + id + "期开出号码:<b>" + model.WinNum + "</b>");
            if (ptype == 1)
            {
                builder.Append("<br />共" + recordCount + "注下注");
            }
            else
            {
                builder.Append("<br />共" + recordCount + "注中奖");
            }

            builder.Append(Out.Tab("</div>", "<br />"));

            int k = 1;
            foreach (BCW.Model.Game.Ballpay n in listBallpay)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }

                builder.Append("" + ((pageIndex - 1) * pageSize + k) + ".<a href=\"" + Utils.getUrl("../uinfo.aspx?uid=" + n.UsID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + n.UsName + "</a>");
                if (n.State == 0)
                {
                    builder.Append("买" + n.BuyNum + ",共押" + n.BuyCount + "份/花费" + n.BuyCent + "" + ub.Get("SiteBz") + "[" + DT.FormatDate(n.AddTime, 13) + "]");
                }
                else if (n.State == 1)
                {
                    builder.Append("买" + n.BuyNum + ",共押" + n.BuyCount + "份/花费" + n.BuyCent + "" + ub.Get("SiteBz") + "[" + DT.FormatDate(n.AddTime, 1) + "]");
                    if (n.WinCent > 0)
                    {
                        builder.Append("赢" + n.WinCent + "" + ub.Get("SiteBz") + "");
                    }
                }
                else
                {
                    builder.Append("买" + n.BuyNum + ",共押" + n.BuyCount + "份/花费" + n.BuyCent + "" + ub.Get("SiteBz") + ",赢" + n.WinCent + "" + ub.Get("SiteBz") + "[" + DT.FormatDate(n.AddTime, 1) + "]");
                }


                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("第" + id + "期开出号码:<b>" + model.WinNum + "</b>");
            builder.Append("<br />共0注中奖");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getPage("ball.aspx") + "\">返回上一级</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Example #19
0
 // Test if the managed side correctly reads 12-byte Vector objects in a struct and
 // meet the backend assumptions.
 static void callBack_RPInvoke_Vector3InStruct(DT v)
 {   
     // sum0 = (2,3,4) dot (2,3,4) = 29
     float sum0 = Vector3.Dot(v.a, v.a);
     // sum1 = (11,21,31) dot (11,21,31) = 22 + 42 + 62 = 1523
     float sum1 = Vector3.Dot(v.b, v.b);
     // sum2 = (2,3,4) dot (11,21,31) = 209
     float sum2 = Vector3.Dot(v.a, v.b);
     
     Console.WriteLine("callBack_RPInvoke_Vector3InStruct:");
     Console.WriteLine("    Sum0 = {0} Sum1 = {1} Sum2 = {2}", sum0, sum1, sum2);
     
     result = (sum0 == 29) && (sum1 == 1523) == (sum2 == 209);
 }
Example #20
0
File: PV1.cs Project: snosrap/nhapi
 /**
    * Returns all repetitions of Contract Effective Date (PV1-25).
    */
 public DT[] getContractEffectiveDate()
 {
     DT[] ret = null;
     try {
     Type[] t = this.getField(25);
     ret = new DT[t.Length];
     for (int i = 0; i < ret.Length; i++) {
     ret[i] = (DT)t[i];
     }
     } catch (HL7Exception he) {
     HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value.  This is a bug.", he);
     throw new System.Exception("An unexpected error ocurred", he);
     } catch (System.Exception cce) {
     HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
     throw new System.Exception("An unexpected error ocurred", cce);
       }
      return ret;
 }
Example #21
0
 public bool addDienthoai(DT dt)
 {
     return(dal.addDienthoai(dt));
 }
Example #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Master.Title = "竞猜管理";

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append(Out.waplink(Utils.getUrl("../game/default.aspx"), "游戏") + "&gt;球彩竞猜");
        builder.Append(Out.Tab("</div>", "<br />"));

        if (Utils.GetDomain().Contains("tl88.cc") || Utils.GetDomain().Contains("168yy.cc"))
        {
            Master.Title = "明升竞猜管理";
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<a href=\"" + Utils.getUrl("../guess2/default.aspx") + "\">&gt;&gt;切换皇冠竞猜</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        builder.Append(Out.Tab("<div>", ""));
        int    ptype    = Utils.ParseInt(Utils.GetRequest("ptype", "get", 1, @"^[0-4]$", "0"));
        int    showtype = Utils.ParseInt(Utils.GetRequest("showtype", "get", 1, @"^[0-2]$", "0"));
        string keyword  = Out.UBB(Utils.GetRequest("keyword", "all", 1, "", ""));
        string fly      = "";

        if (ptype == 4)
        {
            fly = Out.UBB(Utils.GetRequest("fly", "get", 2, @"^.+?$", "请选择联赛"));
        }

        builder.Append(Out.waplink(Utils.getUrl("addGuess.aspx"), "增加赛事") + " ");
        builder.Append(Out.waplink(Utils.getUrl("topGuess.aspx"), "排行榜") + " ");
        builder.Append(Out.waplink(Utils.getUrl("search.aspx"), "搜索") + "<br />");
        builder.Append("赛事分析<a href=\"" + Utils.getUrl("stats.aspx?showtype=2") + "\">未开</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("stats.aspx") + "\">完场</a><br />");
        if (ptype == 0)
        {
            builder.Append("全部 ");
        }
        else
        {
            builder.Append(Out.waplink(Utils.getUrl("default.aspx"), "全部") + " ");
        }
        if (ptype == 1)
        {
            builder.Append("足球 ");
        }
        else
        {
            builder.Append(Out.waplink(Utils.getUrl("default.aspx?ptype=1"), "足球") + " ");
        }

        if (ptype == 2)
        {
            builder.Append("篮球 ");
        }
        else
        {
            builder.Append(Out.waplink(Utils.getUrl("default.aspx?ptype=2"), "篮球") + " ");
        }

        if (ptype == 3)
        {
            builder.Append("联赛 ");
        }
        else
        {
            builder.Append(Out.waplink(Utils.getUrl("default.aspx?ptype=3"), "联赛") + "");
        }

        //builder.Append(Out.waplink(Utils.getUrl("super.aspx"), "串串") + "");

        //builder.Append(Out.waplink(Utils.getUrl("clear.aspx?act=actspaceguess"), "一键清空无投注赛事") + "");

        builder.Append(Out.Tab("</div>", "<br />"));

        int    pageSize = 10;
        int    pageIndex;
        int    recordCount;
        string strDay   = "";
        string strWhere = "";

        string[] pageValUrl = { "ptype", "fly", "keyword" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        if (ptype != 3)
        {
            if (keyword == "")
            {
                if (ptype > 0 && ptype < 4)
                {
                    strWhere = "p_type=" + ptype + " ";
                }
                else if (ptype == 4)
                {
                    strWhere = "p_title like '%" + fly + "%'";
                }
                else
                {
                    strWhere = "";
                }
            }
            else
            {
                if (Utils.IsRegex(keyword, @"^\d+$"))
                {
                    strWhere = "id=" + keyword + "";
                }
                else
                {
                    strWhere = "(p_one like '%" + keyword + "%' or p_two like '%" + keyword + "%')";
                }
            }
            string strOrder = "p_TPRtime DESC,ID DESC";
            // 开始读取竞猜
            IList <TPR.Model.guess.BaList> listBaList = new TPR.BLL.guess.BaList().GetBaLists(pageIndex, pageSize, strWhere, strOrder, out recordCount);
            if (listBaList.Count > 0)
            {
                int k = 1;
                foreach (TPR.Model.guess.BaList n in listBaList)
                {
                    if (k % 2 == 0)
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                    else
                    {
                        if (k == 1)
                        {
                            builder.Append(Out.Tab("<div>", ""));
                        }
                        else
                        {
                            builder.Append(Out.Tab("<div>", "<br />"));
                        }
                    }

                    if (DT.GetTime(n.p_TPRtime.ToString(), "MM月dd日").ToString() != strDay.ToString())
                    {
                        builder.Append(DT.GetTime(n.p_TPRtime.ToString(), "MM月dd日") + "<br />");
                    }

                    string Sonce = string.Empty;
                    if (n.p_ison == 1)
                    {
                        Sonce = "(走)";
                    }
                    builder.Append(Out.waplink(Utils.getUrl("editGuess.aspx?gid=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + ""), "[管理]"));
                    builder.AppendFormat(Out.waplink(Utils.getUrl("showGuess.aspx?gid={0}&amp;backurl=" + Utils.PostPage(1) + ""), "{1}{2}VS{3}{4}") + "", n.ID, DT.FormatDate(Convert.ToDateTime(n.p_TPRtime), 13), n.p_one, n.p_two, Sonce);
                    if (n.p_active > 0)
                    {
                        if (n.p_active == 2)
                        {
                            builder.Append("(已平盘)");
                        }
                        else
                        {
                            if (n.p_result_one != null && n.p_result_two != null)
                            {
                                builder.Append("(比分:" + n.p_result_one + ":" + n.p_result_two + ")");
                            }
                        }
                    }
                    if (n.p_del == 1)
                    {
                        builder.Append("(已隐藏)");
                    }

                    builder.Append(Out.Tab("</div>", ""));
                    strDay = DT.GetTime(n.p_TPRtime.ToString(), "MM月dd日").ToString();
                    k++;
                }

                // 分页
                builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
            }
            else
            {
                builder.Append(Out.Div("div", "没有相关记录.."));
            }
        }

        else
        {
            string strLXWhere = "p_active=0";

            // 开始读取竞猜
            IList <TPR.Model.guess.BaList> listBaListLX = new TPR.BLL.guess.BaList().GetBaListLX(pageIndex, pageSize, strLXWhere, out recordCount);
            if (listBaListLX.Count > 0)
            {
                int k = 1;
                foreach (TPR.Model.guess.BaList n in listBaListLX)
                {
                    if (k % 2 == 0)
                    {
                        builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                    }
                    else
                    {
                        if (k == 1)
                        {
                            builder.Append(Out.Tab("<div>", ""));
                        }
                        else
                        {
                            builder.Append(Out.Tab("<div>", "<br />"));
                        }
                    }

                    builder.AppendFormat(Out.waplink(Utils.getUrl("default.aspx?ptype=4&amp;fly={0}"), "-{1}(共{2}场)") + "", n.p_title, n.p_title, new TPR.BLL.guess.BaList().GetCountByp_title(n.p_title));
                    builder.Append(Out.Tab("</div>", ""));

                    k++;
                }

                // 分页
                builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
            }
            else
            {
                builder.Append(Out.Div("div", "没有相关记录.."));
            }
        }
        string strText = "输入球队或赛事ID:/,";
        string strName = "keyword,backurl";
        string strType = "text,hidden";
        string strValu = "'" + Utils.getPage(0) + "";
        string strEmpt = "true,false";
        string strIdea = "/";
        string strOthe = "搜赛事,default.aspx,post,1,red";

        builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        if (keyword != "")
        {
            builder.Append(Out.Tab("<div>", " "));
            builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">返回</a>");
            builder.Append(Out.Tab("</div>", ""));
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("clear.aspx") + "\">清空记录</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("../xml/guessset.aspx?backurl=" + Utils.PostPage(1) + "") + "\">游戏配置</a>");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
        builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
    }
        public static int DrawTextW(HandleRef hdc, string lpchText, int cchText, ref RECT lprc, DT format)
        {
            int result = DrawTextW((Gdi32.HDC)hdc.Handle, lpchText, cchText, ref lprc, format);

            GC.KeepAlive(hdc.Wrapper);
            return(result);
        }
Example #24
0
 public void Should_Serialize_yyyyMMdd()
 {
     var date = new DT(2015, 12, 31);
     Assert.AreEqual("20151231", date.Value);
 }
Example #25
0
    private void EditCentPage()
    {
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID无效"));

        BCW.Model.Forumvotelog model = new BCW.BLL.Forumvotelog().GetForumvotelog(id);
        if (model == null)
        {
            Utils.Error("不存在的记录", "");
        }
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("编辑奖励");
        builder.Append(Out.Tab("</div>", ""));
        string strText = "用户ID:/,用户昵称:/,管理员ID:/,主题标题:/,cID:/,论坛ID:/,日志内容:/,添加时间:/,,,";
        string strName = "UsID,UsName,AdminId,Title,BID,ForumId,Notes,AddTime,id,act,backurl";
        string strType = "num,text,num,text,num,num,textarea,date,hidden,hidden,hidden";
        string strValu = "" + model.UsID + "'" + model.UsName + "'" + model.AdminId + "'" + model.Title + "'" + model.BID + "'" + model.ForumId + "'" + model.Notes + "'" + DT.FormatDate(model.AddTime, 0) + "'" + id + "'editcentsave'" + Utils.getPage(0) + "";
        string strEmpt = "false,false,false,false,false,false,false,false,false,false,false";
        string strIdea = "/";
        string strOthe = "确定编辑,Gsadmin.aspx,post,1,red";

        builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", " "));
        builder.Append("<a href=\"" + Utils.getPage("Gsadmin.aspx?act=cent") + "\">返回上级</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">应用中心</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Example #26
0
    private void TextPage()
    {
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "红包群ID错误"));

        BCW.Model.Chat model = new BCW.BLL.Chat().GetChatBasic(id);
        if (model == null)
        {
            Utils.Error("不存在的红包群", "");
        }
        Master.Title = "" + model.ChatName + "聊天记录";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("" + model.ChatName + "聊天记录");
        builder.Append(Out.Tab("</div>", "<br />"));

        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "act", "id", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        //查询条件
        strWhere = "ChatId=" + id + "";
        // 开始读取列表
        IList <BCW.Model.ChatText> listChatText = new BCW.BLL.ChatText().GetChatTexts(pageIndex, pageSize, strWhere, out recordCount);

        if (listChatText.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.ChatText n in listChatText)
            {
                if (k == 1)
                {
                    builder.Append(Out.Tab("<div>", ""));
                }
                else
                {
                    builder.Append(Out.Tab("<div>", "<br />"));
                }

                builder.Append((pageIndex - 1) * pageSize + k + ".");
                int    Isac    = 0;
                string Content = n.Content.Trim();
                if (Content.Contains("$N"))
                {
                    Isac    = 1;
                    Content = Content.Replace("$N", n.UsName).Replace("$n", n.ToName);
                }
                builder.AppendFormat("<a href=\"" + Utils.getUrl("uinfo.aspx?uid={0}&amp;backurl=" + Utils.PostPage(1) + "") + "\">{1}({0})</a>", n.UsID, n.UsName);

                if (n.ToID == 0)
                {
                    builder.AppendFormat(":{0}[{1}]", Out.SysUBB(Content), DT.FormatDate(n.AddTime, 10));
                }
                else
                {
                    if (Isac == 0)
                    {
                        builder.AppendFormat("对{0}说", n.ToName);
                    }
                    builder.AppendFormat(":{0}[{1}]", Out.SysUBB(Content), DT.FormatDate(n.AddTime, 10));
                }
                builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=deltext&amp;id=" + n.ChatId + "&amp;uid=" + n.UsID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[删]</a>");
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getPage("chat.aspx") + "\">返回上一级</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=clear&amp;id=" + id + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">清空聊天记录</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Example #27
0
 public void Should_Serialize_leap_year()
 {
     var date = new DT(2012, 2, 29);
     Assert.AreEqual("20120229", date.Value);
 }
Example #28
0
    private void ReloadPage()
    {
        int uid   = int.Parse(Utils.GetRequest("uid", "all", 1, @"^[0-9]\d*$", "0"));
        int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[0-9]\d*$", "0"));
        int id    = int.Parse(Utils.GetRequest("id", "all", 1, @"^[0-9]\d*$", "0"));

        Master.Title = "商品订单管理";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("商品订单管理");
        builder.Append(Out.Tab("</div>", "<br />"));
        if (id != 0)
        {
            if (!new BCW.BLL.Goods().Exists(id))
            {
                Utils.Error("不存在的记录", "");
            }
            string Title = new BCW.BLL.Goods().GetTitle(id);
            builder.Append(Out.Tab("<div class=\"text\">", ""));

            builder.Append("<a href=\"" + Utils.getUrl("../shopdetail.aspx?id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">.." + Title + "</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }

        builder.Append(Out.Tab("<div class=\"text\">", ""));
        if (ptype == 0)
        {
            builder.Append("待审|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&amp;uid=" + uid + "&amp;ptype=0&amp;backurl=" + Utils.getPage(0) + "") + "\">待审</a>|");
        }

        if (ptype == 1)
        {
            builder.Append("待发|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&amp;uid=" + uid + "&amp;ptype=1&amp;backurl=" + Utils.getPage(0) + "") + "\">待发</a>|");
        }

        if (ptype == 2)
        {
            builder.Append("已发|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&amp;uid=" + uid + "&amp;ptype=2&amp;backurl=" + Utils.getPage(0) + "") + "\">已发</a>|");
        }

        if (ptype == 3)
        {
            builder.Append("成功|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&amp;uid=" + uid + "&amp;ptype=3&amp;backurl=" + Utils.getPage(0) + "") + "\">成功</a>|");
        }

        if (ptype == 4)
        {
            builder.Append("失败");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&amp;uid=" + uid + "&amp;ptype=4&amp;backurl=" + Utils.getPage(0) + "") + "\">失败</a>");
        }

        builder.Append(Out.Tab("</div>", "<br />"));


        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "id", "uid", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        if (uid != 0)
        {
            strWhere += "userid=" + uid + "and ";
        }
        strWhere += " AcStats=" + ptype + "";

        // 开始读取列表
        IList <BCW.Model.Buylist> listBuylist = new BCW.BLL.Buylist().GetBuylists(pageIndex, pageSize, strWhere, out recordCount);

        if (listBuylist.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Buylist n in listBuylist)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }


                builder.AppendFormat("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=view&amp;id={0}&amp;backurl=" + Utils.PostPage(true) + "") + "\">{2}.{3}</a>(" + BCW.User.AppCase.CaseBuyStats(n.AcStats) + ")<br />共{4}元.{5}", n.ID, pageIndex, (pageIndex - 1) * pageSize + k, n.Title, Convert.ToDouble(n.AcPrice), DT.FormatDate(n.AddTime, 2));

                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }

        if (id == 0)
        {
            string strText = "输入用户ID:/";
            string strName = "uid";
            string strType = "num";
            string strValu = "'";
            string strEmpt = "true";
            string strIdea = "/";
            string strOthe = "搜订单,shopbuy.aspx,post,1,red";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        }

        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        if (Utils.getPage(1) != "")
        {
            builder.Append(" <a href=\"" + Utils.getPage(1) + "\">返回上一级</a><br />");
        }


        //商品推广功能
        if (Utils.GetDomain().Contains("127.0.0.6") || Utils.GetDomain().Contains("xgbxj.net"))
        {
            builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=appbank") + "\">推广拥金结算</a><br />");
        }
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Example #29
0
    /// <summary>
    /// 商品推广拥金结算
    /// </summary>
    private void AppbankPage()
    {
        Master.Title = "推广拥金结算记录";
        int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[0-2]$", "0"));

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("结算记录");
        builder.Append(Out.Tab("</div>", "<br />"));

        builder.Append(Out.Tab("<div class=\"text\">", ""));
        if (ptype == 0)
        {
            builder.Append("未结算|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=appbank&amp;ptype=0&amp;backurl=" + Utils.getPage(0) + "") + "\">未结算</a>|");
        }

        if (ptype == 1)
        {
            builder.Append("已结算|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=appbank&amp;ptype=1&amp;backurl=" + Utils.getPage(0) + "") + "\">已结算</a>|");
        }

        if (ptype == 2)
        {
            builder.Append("已失败");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=appbank&amp;ptype=2&amp;backurl=" + Utils.getPage(0) + "") + "\">已失败</a>");
        }

        builder.Append(Out.Tab("</div>", "<br />"));

        int    pageIndex;
        int    recordCount;
        int    pageSize = 5;
        string strWhere = "";

        string[] pageValUrl = { "ptype", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        strWhere += "Types=0 and State=" + ptype + "";

        // 开始读取列表
        IList <BCW.Model.Appbank> listAppbank = new BCW.BLL.Appbank().GetAppbanks(pageIndex, pageSize, strWhere, out recordCount);

        if (listAppbank.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Appbank n in listAppbank)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", Out.Hr()));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", Out.Hr()));
                    }
                }
                string sText = string.Empty;
                if (n.State == 0)
                {
                    sText = "申请中";
                }
                else if (n.State == 1)
                {
                    sText = "已汇款";
                }
                else if (n.State == 1)
                {
                    sText = "已失败";
                }

                builder.Append("<b>[" + sText + "]</b><a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + n.UsID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + n.UsName + "(" + n.UsID + ")</a>申请" + n.AddGold + "元[" + DT.FormatDate(n.AddTime, 1) + "]");
                if (!string.IsNullOrEmpty(n.Notes))
                {
                    builder.Append("<br />备注:" + n.Notes + "");
                }

                builder.Append("<br />银行卡号:" + n.CardNum + "");
                builder.Append("<br />银行姓名:" + n.CardName + "");
                builder.Append("<br />开户银行:" + n.CardAddress + "");
                builder.Append("<br />手机号:" + n.Mobile + "");

                if (n.State > 0)
                {
                    builder.Append("<br />受理时间:" + n.ReTime + "");
                    if (!string.IsNullOrEmpty(n.AdminNotes))
                    {
                        builder.Append("<br />备注:" + n.AdminNotes + "");
                    }
                }
                builder.Append("<br /><a href=\"" + Utils.getUrl("shopbuy.aspx?act=editappbank&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">管理此结算</a>");

                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }

        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx") + "\">返回上一级</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Example #30
0
 static void P(DT dt)
 {
     Console.WriteLine("True");
     dt(new T());
 }
Example #31
0
    public static bool test() 
    {

        // Expected return value is 12 bytes.
        if (nativeCall_PInvoke_CheckVector3Size() != 12) 
        {
            Console.WriteLine("The size of native Vector3 type is not 12 bytes");
            return false;            
        }

        // Argument passing test.
        // The native code accesses only 12 bytes for each Vector object.
        {
            int iv = 123;
            Vector3 v1 = new Vector3(1,2,3);
            string str = "abcdefg";
            Vector3 v2 = new Vector3(10,11,12);
            // Expected return value = 1 + 2 + 3 + 10 + 11 + 12 = 39
            if (nativeCall_PInvoke_Vector3Arg(iv, v1, str, v2) != 39) 
            {
                Console.Write("PInvoke Vector3Arg test failed\n");
                return false;            
            }
        }
        
        // Argument passing test for Unix.
        // Few arguments are passed onto stack.
        {
            Vector3 v1 = new Vector3(1, 2, 3);
            Vector3 v2 = new Vector3(10, 20, 30);
            float f0 = 100, f1 = 101, f2 = 102, f3 = 103, f4 = 104, f5 = 105, f6 = 106, f7 = 107, f8 = 108;
            
            float sum = nativeCall_PInvoke_Vector3Arg_Unix(
                v1, // register
                f0, f1, f2, f3, f4, f5, // register
                f6, v2,  // stack
                f7, f8); // stack
            if (sum != 1002) {
                Console.Write("PInvoke Vector3Arg_Unix test failed\n");
                return false;            
            }
        }
        
        // Argument passing test for Unix.
        // Few arguments are passed onto stack.
        {
            Vector3 v1 = new Vector3(1, 2, 3);
            Vector3 v2 = new Vector3(4, 5, 6);
            Vector3 v3 = new Vector3(7, 8, 9);
            float f0 = 100, f1 = 101, f2 = 102, f3 = 103, f4 = 104, f5 = 105, f6 = 106, f7 = 107, f8 = 108, f9 = 109;
            
            float sum = nativeCall_PInvoke_Vector3Arg_Unix2(
                v1, // register
                f0, f1, f2, f3, f4, f5, // register
                f6, v2,  // stack
                f7, f8,  // stack
                v3,      // stack
                f9);     // stack
            if (sum != 1090) {
                Console.Write("PInvoke Vector3Arg_Unix2 test failed\n");
                return false;            
            }
        }        
        
        // JIT crashes with this testcase.
        // Disabled temporarily.
        {
            Vector3 ret = nativeCall_PInvoke_Vector3Ret();
            // Expected return value = (1, 2, 3) dot (1, 2, 3) = 14
            float sum = Vector3.Dot(ret, ret);
            if (sum != 14) {
                Console.WriteLine("PInvoke Vector3Ret test failed");
                return false;            
            }
        }
        
        // Array argument test.
        // Both the managed and native code assumes 12 bytes for each element.
        {
            Vector3[] v3_array = new Vector3[2];
            v3_array[0].X = 1; v3_array[0].Y = 2; v3_array[0].Z = 3;
            v3_array[1].X = 5; v3_array[1].Y = 6; v3_array[1].Z = 7;
            // Expected resutn value = 1 + 2 + 3 + 5 + 6 + 7 = 24
            if (nativeCall_PInvoke_Vector3Array(v3_array) != 24) 
            {
                Console.WriteLine("PInvoke Vector3Array test failed");
                return false;            
            }
        }
        
        // Structure pass and return test.
        // Both the managed and native side use 12 bytes for each Vector3 object.
        // Dot product makes sure that the backend assumption 1 and 2 are met.
        {
            DT data = new DT();
            data.a = new Vector3(1,2,3);
            data.b = new Vector3(5,6,7);
            DT ret = nativeCall_PInvoke_Vector3InStruct(data);
            // Expected return value = (2, 3, 4) dot (6, 7, 8) = 12 + 21 + 32 = 65
            float sum = Vector3.Dot(ret.a, ret.b);
            if (sum != 65) 
            {
                Console.WriteLine("PInvoke Vector3InStruct test failed");
                return false;            
            }
        }

        // Complex struct test
        // Dot product makes sure that the backend assumption 1 and 2 are met.
        {
            ComplexDT cdt = new ComplexDT();
            cdt.iv = 99;
            cdt.str = "arg_string";
            cdt.vecs.a = new Vector3(1,2,3);
            cdt.vecs.b = new Vector3(5,6,7);
            cdt.v3 = new Vector3(10, 20, 30);

            nativeCall_PInvoke_Vector3InComplexStruct(ref cdt);
            
            Console.WriteLine("    Managed ival: {0}", cdt.iv);
            Console.WriteLine("    Managed Vector3 v1: ({0} {1} {2})", cdt.vecs.a.X, cdt.vecs.a.Y, cdt.vecs.a.Z);
            Console.WriteLine("    Managed Vector3 v2: ({0} {1} {2})", cdt.vecs.b.X, cdt.vecs.b.Y, cdt.vecs.b.Z);
            Console.WriteLine("    Managed Vector3 v3: ({0} {1} {2})", cdt.v3.X, cdt.v3.Y, cdt.v3.Z);
            Console.WriteLine("    Managed string arg: {0}", cdt.str); 
               
            // (2, 3, 4) dot (6, 7 , 8) = 12 + 21 + 32 = 65
            float t0 = Vector3.Dot(cdt.vecs.a, cdt.vecs.b);
            // (6, 7, 8) dot (11, 21, 31) = 66 + 147 + 248 = 461
            float t1 = Vector3.Dot(cdt.vecs.b, cdt.v3);
            // (11, 21, 31) dot (2, 3, 4) = 209
            float t2 = Vector3.Dot(cdt.v3, cdt.vecs.a);
            float sum = t0 + t1 + t2;
            
            Console.WriteLine("    Managed Sum = {0}", sum);
            if ((sum != 735) || (cdt.iv != 100) || (cdt.str.ToString() != "ret_string"))
            {
                Console.WriteLine("PInvoke Vector3InStruct test failed"); 
                return false;            
            }
        }        

        Console.WriteLine("All PInvoke testcases passed");
        return true;
    }    
Example #32
0
    private void ReloadPage()
    {
        int ptype   = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[1-2]$", "0"));
        int forumid = int.Parse(Utils.GetRequest("forumid", "get", 1, @"^[1-9]\d*$", "0"));

        BCW.Model.Forum m = null;

        Master.Title = "在线会员";
        if (forumid > 0)
        {
            if (ub.GetSub("BbsIsOnline", "/Controls/bbs.xml") != "0")
            {
                Utils.Error("未开放此功能", "");
            }
            m = new BCW.BLL.Forum().GetForumBasic(forumid);
            if (m == null)
            {
                Utils.Error("不存在的论坛记录", "");
            }

            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("<a href=\"" + Utils.getUrl("forum.aspx?forumid=" + forumid + "") + "\">" + m.Title + "</a>&gt;在线会员");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        else
        {
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            if (ptype == 1)
            {
                builder.Append("全站美女在线");
            }
            else if (ptype == 2)
            {
                builder.Append("全站帅哥在线");
            }
            else
            {
                builder.Append("全站在线会员");
            }

            builder.Append(Out.Tab("</div>", "<br />"));
        }
        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "ptype", "forumid", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        if (forumid > 0)
        {
            strWhere += "EndForumID=" + forumid + " and EndTime>='" + DateTime.Now.AddMinutes(-Convert.ToInt32(ub.Get("SiteExTime"))) + "'";
        }
        else
        {
            //查询条件
            if (ptype == 1)
            {
                strWhere = "Sex<=1 and";
            }
            else if (ptype == 2)
            {
                strWhere = "Sex=2 and";
            }

            strWhere += " EndTime>='" + DateTime.Now.AddMinutes(-Convert.ToInt32(ub.Get("SiteExTime"))) + "'";
        }
        // 开始读取列表
        IList <BCW.Model.User> listUser = new BCW.BLL.User().GetUsers(pageIndex, pageSize, strWhere, out recordCount);

        if (listUser.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.User n in listUser)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }
                //if (n.State == 1)
                //    builder.Append("" + ((pageIndex - 1) * pageSize + k) + ".隐身会员");

                builder.Append("<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + BCW.User.Users.SetUser(n.ID) + "(" + n.ID + ")</a>");

                k++;
                builder.Append(Out.Tab("</div>", ""));
            }
            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 1));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div>", "<br />"));
        if (forumid > 0)
        {
            builder.Append("最高" + m.TopLine + "人,发生在" + DT.FormatDate(m.TopTime, 5) + "<br />");
            builder.Append("<a href=\"" + Utils.getUrl("forum.aspx?forumid=" + forumid + "") + "\">返回" + m.Title + "</a>");
        }
        else
        {
            builder.Append("帅哥<a href=\"" + Utils.getUrl("online.aspx?ptype=2&amp;backurl=" + Utils.getPage(0) + "") + "\">" + new BCW.BLL.User().GetNum(2) + "</a>|美女<a href=\"" + Utils.getUrl("online.aspx?ptype=1&amp;backurl=" + Utils.getPage(0) + "") + "\">" + new BCW.BLL.User().GetNum(1) + "</a>");
        }
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getPage("uinfo.aspx") + "\">上级</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Example #33
0
	public static int Main () {
		DT t = new DT ();
		if (t.Ticks != 1)
			return 1;
		return 0;
	}
Example #34
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    gid = Utils.ParseInt(Utils.GetRequest("gid", "all", 2, @"^[0-9]*$", "竞猜ID无效"));
        string ac  = Utils.GetRequest("ac", "all", 1, "", "");

        TPR2.BLL.guess.BaList bll = new TPR2.BLL.guess.BaList();

        if (bll.GetModel(gid) == null)
        {
            Utils.Error("不存在的记录", "");
        }
        TPR2.Model.guess.BaList model = bll.GetModel(gid);
        Master.Title = "开奖赛事" + model.p_one + "VS" + model.p_two;
        int ManageId = new BCW.User.Manage().IsManageLogin();

        //开奖限制
        if (model.p_opentime == DateTime.Parse("1990-1-1"))
        {
            if (Convert.ToDateTime(model.p_TPRtime).AddHours(8) < DateTime.Now)
            {
                if (Utils.GetTopDomain().Contains("tuhao") || Utils.GetTopDomain().Contains("th"))
                {
                    if (ManageId != 1 && ManageId != 2)
                    {
                        Utils.Error("未开奖的比赛超8小时后不能再开奖", "");
                    }
                }
                else
                {
                    if (ManageId != 1 && ManageId != 9)
                    {
                        Utils.Error("未开奖的比赛超8小时后不能再开奖", "");
                    }
                }
            }
        }
        else
        {
            if (model.p_opentime.AddHours(3) < DateTime.Now)
            {
                if (Utils.GetTopDomain().Contains("tuhao") || Utils.GetTopDomain().Contains("th"))
                {
                    if (ManageId != 1 && ManageId != 2)
                    {
                        Utils.Error("开奖后已超3小时,不能进行重新开奖", "");
                    }
                }
                else
                {
                    if (ManageId != 1 && ManageId != 9)
                    {
                        Utils.Error("开奖后已超3小时,不能进行重新开奖", "");
                    }
                }
            }
        }



        if (Utils.ToSChinese(ac) == "确定开奖" || Utils.ToSChinese(ac) == "确定重开奖")
        {
            int resultone = Utils.ParseInt(Utils.GetRequest("resultone", "post", 2, @"^[0-9]*$", "请正确输入比分"));
            int resulttwo = Utils.ParseInt(Utils.GetRequest("resulttwo", "post", 2, @"^[0-9]*$", "请正确输入比分"));
            int iType     = Utils.ParseInt(Utils.GetRequest("iType", "post", 2, @"^[1-3]*$", "请正确选择开奖模式"));

            DateTime oTime = DateTime.Now;
            string   pSms  = "";
            if (iType == 2)
            {
                oTime = Utils.ParseTime(Utils.GetRequest("oTime", "post", 2, DT.RegexTime, "请正确填写截止时间"));
                pSms  = Out.UBB(Utils.GetRequest("pSms", "post", 2, @"^[\s\S]{2,20}$", "请输入2-20字的平盘原因"));
            }
            else if (iType == 3)
            {
                pSms = Out.UBB(Utils.GetRequest("pSms", "post", 2, @"^[\s\S]{2,20}$", "请输入2-20字的平盘原因"));
            }

            string Info     = Utils.GetRequest("Info", "post", 1, "", "");
            string onceTime = Utils.GetRequest("onceTime", "post", 1, "", "");
            if (Info == "ok")
            {
                //游戏日志记录

                string[] p_pageArr = { "ac", "gid", "resultone", "resulttwo", "p_one", "iType", "oTime", "pSms", "Info", "onceTime" };
                if (model.p_result_one != null && model.p_result_two != null)
                {
                    BCW.User.GameLog.GameLogPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号重新开奖" + model.p_one + "VS" + model.p_two + "(" + gid + "),比分" + resultone + ":" + resulttwo + "", gid);
                }
                else
                {
                    BCW.User.GameLog.GameLogPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号开奖" + model.p_one + "VS" + model.p_two + "(" + gid + "),比分" + resultone + ":" + resulttwo + "", gid);
                }

                //重开奖处理:
                if (model.p_result_one != null && model.p_result_two != null)
                {
                    DataSet ds = new TPR2.BLL.guess.BaPay().GetBaPayList("pType,payview,payusid,payusname,payCent,p_getMoney,types", "bcid=" + gid + " and p_case=1 and itypes=0 ");
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            int    pType      = int.Parse(ds.Tables[0].Rows[i]["pType"].ToString());
                            string payview    = ds.Tables[0].Rows[i]["payview"].ToString();
                            int    payusid    = int.Parse(ds.Tables[0].Rows[i]["payusid"].ToString());
                            string payusname  = ds.Tables[0].Rows[i]["payusname"].ToString();
                            long   payCent    = Convert.ToInt64(Convert.ToDecimal(ds.Tables[0].Rows[i]["payCent"].ToString()));
                            long   p_getMoney = Convert.ToInt64(Convert.ToDecimal(ds.Tables[0].Rows[i]["p_getMoney"].ToString()));
                            int    bzType     = int.Parse(ds.Tables[0].Rows[i]["types"].ToString());
                            long   gold       = 0;
                            long   cMoney     = 0; //差多少
                            long   sMoney     = 0; //实扣
                            if (bzType == 0)
                            {
                                gold = new BCW.BLL.User().GetGold(payusid);
                            }
                            else
                            {
                                gold = new BCW.BLL.User().GetMoney(payusid);
                            }

                            if (p_getMoney > gold)
                            {
                                cMoney = p_getMoney - gold;
                                sMoney = gold;
                            }
                            else
                            {
                                sMoney = p_getMoney;
                            }

                            //重开奖的在本场没兑奖时就没显示在欠币日志,

                            //操作币并内线通知
                            if (bzType == 0)
                            {
                                new BCW.BLL.User().UpdateiGold(payusid, payusname, -sMoney, "球彩赛事ID" + gid + "重开奖,扣除已兑奖" + ub.Get("SiteBz") + "");
                                //发送内线
                                string strGuess = "球彩赛事ID" + gid + "重开奖,你欠下系统的" + p_getMoney + "" + ub.Get("SiteBz") + ".[br]根据您的帐户数额,实扣" + sMoney + "" + ub.Get("SiteBz") + ".[br]如果您的" + ub.Get("SiteBz") + "不足,系统将您帐户冻结,直到成功扣除为止。[br]" + payview + "(原开奖" + model.p_result_one + ":" + model.p_result_two + "|新开奖" + resultone + ":" + resulttwo + ")";
                                new BCW.BLL.Guest().Add(1, payusid, payusname, strGuess);
                            }
                            else
                            {
                                new BCW.BLL.User().UpdateiMoney(payusid, payusname, -sMoney, "球彩赛事ID" + gid + "重开奖,扣除已兑奖" + ub.Get("SiteBz2") + "");
                                //发送内线
                                string strGuess = "球彩赛事ID" + gid + "重开奖,你欠下系统的" + p_getMoney + "" + ub.Get("SiteBz2") + ".[br]根据您的帐户数额,实扣" + sMoney + "" + ub.Get("SiteBz2") + ".[br]如果您的" + ub.Get("SiteBz2") + "不足,系统将您帐户冻结,直到成功扣除为止。[br]" + payview + "(原开奖" + model.p_result_one + ":" + model.p_result_two + "|新开奖" + resultone + ":" + resulttwo + ")";
                                new BCW.BLL.Guest().Add(1, payusid, payusname, strGuess);
                            }
                            //如果币不够扣则记录日志并冻结IsFreeze
                            if (cMoney > 0)
                            {
                                BCW.Model.Gameowe owe = new BCW.Model.Gameowe();
                                owe.Types   = 1;
                                owe.UsID    = payusid;
                                owe.UsName  = payusname;
                                owe.Content = "" + payview + "(原开奖" + model.p_result_one + ":" + model.p_result_two + "|新开奖" + resultone + ":" + resulttwo + ")";
                                owe.OweCent = cMoney;
                                owe.BzType  = bzType;
                                owe.EnId    = gid;
                                owe.AddTime = DateTime.Now;
                                new BCW.BLL.Gameowe().Add(owe);

                                new BCW.BLL.User().UpdateIsFreeze(payusid, 1);
                            }

                            //取消得到的排行
                            TPR2.Model.guess.BaOrder objBaOrder = new TPR2.Model.guess.BaOrder();
                            objBaOrder.Orderusid   = payusid;
                            objBaOrder.Orderusname = payusname;
                            objBaOrder.Orderfanum  = 0;
                            objBaOrder.Orderjbnum  = -(p_getMoney - payCent);
                            objBaOrder.Orderbanum  = -1;
                            objBaOrder.Orderstats  = pType;
                            new TPR2.BLL.guess.BaOrder().UpdateOrder(objBaOrder);
                        }
                    }
                }

                int OnceMin = Convert.ToInt32(ub.GetSub("SiteOnce", xmlPath));//" + ub.Get("SiteGqText") + "时间限制

                //是否" + ub.Get("SiteGqText") + "赛事
                int ison = Convert.ToInt32(model.p_ison);

                //取得比分时间段

                string stronce = string.Empty;
                if (ison == 1)
                {
                    stronce = onceTime;

                    if (string.IsNullOrEmpty(stronce))
                    {
                        stronce      = footonce(Convert.ToInt32(model.p_id), Convert.ToDateTime(model.p_TPRtime));
                        model.ID     = gid;
                        model.p_once = stronce;
                        new TPR2.BLL.guess.BaList().UpdateOnce(model);
                    }
                    stronce = stronce.Replace("#", "|");
                }


                //更新比分
                model.p_result_one = resultone;
                model.p_result_two = resulttwo;

                if (iType == 3)
                {
                    model.p_active = 2;//平盘标识
                }
                else
                {
                    model.p_active = 1;
                }

                bll.UpdateResult(model);
                //更新开奖时间
                new TPR2.BLL.guess.BaList().Updatep_opentime(gid);

                int     recordCount = 0;
                int     p_intWin    = 0;
                decimal p_intDuVal  = 0;
                //组合查询条件
                string strppWhere = "";
                string strWhere   = "";
                strppWhere = "bcid=" + gid + "";
                strWhere   = "bcid=" + gid + "";
                if (iType == 2)
                {
                    strWhere   += "and paytimes<='" + oTime + "'";
                    strppWhere += "and paytimes>'" + oTime + "'";
                }


                if (iType < 3)
                {
                    TPR2.Model.guess.BaOrder objBaOrder = new TPR2.Model.guess.BaOrder();

                    // 开始查询并更新之
                    IList <TPR2.Model.guess.BaPay> listBaPay = new TPR2.BLL.guess.BaPay().GetBaPays(1, 8000, strWhere, out recordCount);
                    if (listBaPay.Count > 0)
                    {
                        foreach (TPR2.Model.guess.BaPay n in listBaPay)
                        {
                            int Iszd = 0;
                            n.p_result_one = resultone;
                            n.p_result_two = resulttwo;
                            n.p_active     = 1;
                            //币种
                            string bzTypes = string.Empty;
                            if (n.Types == 0)
                            {
                                bzTypes = ub.Get("SiteBz");
                            }
                            else
                            {
                                bzTypes = ub.Get("SiteBz2");
                            }

                            if (model.p_type == 1)
                            {
                                //是否可以平盘了
                                if (n.PayType <= 4)
                                {
                                    if (!string.IsNullOrEmpty(stronce))
                                    {
                                        string[] Sonce = stronce.Split("|".ToCharArray());

                                        for (int i = 0; i < Sonce.Length; i++)
                                        {
                                            if (Convert.ToDateTime(Sonce[i]).AddSeconds(OnceMin) > Convert.ToDateTime(n.paytimes) && Convert.ToDateTime(Sonce[i]).AddSeconds(-OnceMin) < Convert.ToDateTime(n.paytimes))
                                            {
                                                Iszd = 2;//平盘标识
                                            }
                                        }
                                    }
                                }
                                if (Iszd == 0)
                                {
                                    if (n.PayType == 1 || n.PayType == 2)
                                    {
                                        string p_strVal = string.Empty;
                                        if (ison == 1)//如果是" + ub.Get("SiteGqText") + "模式
                                        {
                                            n.p_result_one = resultone - Convert.ToInt32(n.p_result_temp1);
                                            n.p_result_two = resulttwo - Convert.ToInt32(n.p_result_temp2);
                                            p_strVal       = ZqClass.getZqsxCase(n);
                                            //重新取值
                                            n.p_result_one = resultone;
                                            n.p_result_two = resulttwo;
                                        }
                                        else
                                        {
                                            p_strVal = ZqClass.getZqsxCase(n);
                                        }
                                        new TPR2.BLL.guess.BaPay().UpdateCase(n, p_strVal, out p_intDuVal, out p_intWin);
                                        Iszd = 1;//" + ub.Get("SiteGqText") + "模式
                                    }
                                    else if (n.PayType == 3 || n.PayType == 4)
                                    {
                                        new TPR2.BLL.guess.BaPay().UpdateCase(n, ZqClass.getZqdxCase(n), out p_intDuVal, out p_intWin);
                                    }
                                    else if (n.PayType == 5 || n.PayType == 6 || n.PayType == 7)
                                    {
                                        new TPR2.BLL.guess.BaPay().UpdateCase(n, ZqClass.getZqbzCase(n), out p_intDuVal, out p_intWin);
                                    }
                                    else//波胆开奖
                                    {
                                        new TPR2.BLL.guess.BaPay().UpdateCase(n, ZqClass.getZqScoreCase(n), out p_intDuVal, out p_intWin);
                                    }
                                }
                            }
                            else
                            {
                                if (n.PayType == 1 || n.PayType == 2)
                                {
                                    new TPR2.BLL.guess.BaPay().UpdateCase(n, LqClass.getLqsxCase(n), out p_intDuVal, out p_intWin);
                                }
                                else
                                {
                                    new TPR2.BLL.guess.BaPay().UpdateCase(n, LqClass.getLqdxCase(n), out p_intDuVal, out p_intWin);
                                }
                            }
                            if (Iszd != 2)
                            {
                                if (Convert.ToInt32(n.itypes) == 0)
                                {
                                    if (p_intWin == 1)
                                    {
                                        //更新排行榜:赢

                                        objBaOrder.Orderusid   = n.payusid;
                                        objBaOrder.Orderusname = n.payusname;

                                        if (p_intDuVal == n.payCent)
                                        {
                                            objBaOrder.Orderbanum = 0;
                                            objBaOrder.Orderjbnum = 0;
                                        }
                                        else
                                        {
                                            objBaOrder.Orderbanum = 1;
                                            objBaOrder.Orderjbnum = p_intDuVal - n.payCent;
                                        }
                                        objBaOrder.Orderfanum = 0;

                                        objBaOrder.Orderstats = n.pType;
                                        new TPR2.BLL.guess.BaOrder().UpdateOrder(objBaOrder);
                                        //发送内线
                                        string strLog = string.Empty;
                                        if (Iszd == 1)  //" + ub.Get("SiteGqText") + "的内线提醒
                                        {
                                            strLog = "" + n.payview + "[br]结果:" + resultone + ":" + resulttwo + "(下注" + n.p_result_temp1 + ":" + n.p_result_temp2 + "),系统返" + Convert.ToDouble(p_intDuVal) + "" + bzTypes + "[url=/bbs/guess2/caseGuess.aspx]马上兑奖[/url]";
                                        }
                                        else
                                        {
                                            strLog = "" + n.payview + "[br]结果:" + resultone + ":" + resulttwo + ",系统返" + Convert.ToDouble(p_intDuVal) + "" + bzTypes + "[url=/bbs/guess2/caseGuess.aspx]马上兑奖[/url]";
                                        }

                                        new BCW.BLL.Guest().Add(1, Convert.ToInt32(n.payusid), n.payusname, strLog);
                                    }
                                    else
                                    {
                                        //更新排行榜:输

                                        objBaOrder.Orderusid   = n.payusid;
                                        objBaOrder.Orderusname = n.payusname;
                                        objBaOrder.Orderbanum  = 0;

                                        objBaOrder.Orderfanum = 1;

                                        objBaOrder.Orderjbnum = -n.payCent;
                                        objBaOrder.Orderbanum = 0;

                                        objBaOrder.Orderstats = n.pType;
                                        new TPR2.BLL.guess.BaOrder().UpdateOrder(objBaOrder);
                                    }
                                }
                            }
                            else
                            {
                                //平盘
                                n.p_result_one = resultone;
                                n.p_result_two = resulttwo;
                                n.p_active     = 2;
                                n.p_getMoney   = n.payCent;
                                new TPR2.BLL.guess.BaPay().UpdatePPCase(n);
                                //发送内线
                                if (Convert.ToInt32(n.itypes) == 0)
                                {
                                    //发送内线
                                    string strLog = "" + n.payview + "[br]结果平盘,原因:" + ub.Get("SiteGqText") + "赛事,系统将比分变动前后" + OnceMin + "秒钟的下注作平盘处理,返还" + Convert.ToDouble(n.payCent) + "" + bzTypes + "[url=/bbs/guess2/caseGuess.aspx]马上兑奖[/url][br]本场赛事变动时间如下:[br]" + stronce.Replace("|", "[br]") + "";
                                    new BCW.BLL.Guest().Add(1, Convert.ToInt32(n.payusid), n.payusname, strLog);
                                }
                            }
                        }
                    }
                }
                if (iType == 2 || iType == 3)
                {
                    // 平盘返还
                    IList <TPR2.Model.guess.BaPay> listBaPay = new TPR2.BLL.guess.BaPay().GetBaPays(1, 8000, strppWhere, out recordCount);
                    if (listBaPay.Count > 0)
                    {
                        foreach (TPR2.Model.guess.BaPay n in listBaPay)
                        {
                            n.p_result_one = resultone;
                            n.p_result_two = resulttwo;
                            n.p_active     = 2;
                            n.p_getMoney   = n.payCent;
                            //币种
                            string bzTypes = string.Empty;
                            if (n.Types == 0)
                            {
                                bzTypes = ub.Get("SiteBz");
                            }
                            else
                            {
                                bzTypes = ub.Get("SiteBz2");
                            }

                            new TPR2.BLL.guess.BaPay().UpdatePPCase(n);

                            //发送内线
                            if (Convert.ToInt32(n.itypes) == 0)
                            {
                                //发送内线
                                string strLog = "" + n.payview + "[br]结果平盘,原因:" + pSms + ",系统返还" + Convert.ToDouble(n.payCent) + "" + bzTypes + "[url=/bbs/guess2/caseGuess.aspx]马上兑奖[/url]";
                                new BCW.BLL.Guest().Add(1, Convert.ToInt32(n.payusid), n.payusname, strLog);
                            }
                        }
                    }
                }

                if (iType == 3)
                {
                    BCW.Data.SqlHelper.ExecuteSql("Update tb_Balist set p_id=0 where id=" + gid + "");
                    Utils.Success("开奖", "操作平盘成功..", Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "1");
                }
                else
                {
                    Utils.Success("开奖", "开奖" + resultone + ":" + resulttwo + "成功..", Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "1");
                }
            }
            else
            {
                builder.Append(Out.Tab("<div>", ""));
                if (iType == 1)
                {
                    builder.Append("请确认比分" + resultone + ":" + resulttwo + "");
                }
                else if (iType == 2)
                {
                    builder.Append("请确认比分" + resultone + ":" + resulttwo + "," + DT.FormatDate(oTime, 0) + "");
                }
                else
                {
                    builder.Append("请确认平盘.");
                }
                builder.Append(Out.Tab("</div>", "<br />"));
                string strName = "resultone,resulttwo,iType,oTime,pSms,onceTime,gid,Info";
                string strValu = "" + resultone + "'" + resulttwo + "'" + iType + "'" + DT.FormatDate(oTime, 0) + "'" + pSms + "'" + onceTime + "'" + gid + "'ok";
                string strOthe = "确定开奖,openGuess.aspx,post,0,red";

                builder.Append(Out.wapform(strName, strValu, strOthe));
                builder.Append(Out.Tab("<div>", "<br />"));
                builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "再看看吧.."));
                builder.Append(Out.Tab("</div>", "<br />"));
            }
        }
        else
        {
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("开奖赛事" + model.p_one + "VS" + model.p_two);
            builder.Append(Out.Tab("</div>", "<br />"));

            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("开赛:" + DT.FormatDate(Convert.ToDateTime(model.p_TPRtime), 0));
            builder.Append(Out.Tab("</div>", ""));

            string strText = string.Empty;
            string strName = string.Empty;
            string strType = string.Empty;
            string strValu = string.Empty;
            string strEmpt = string.Empty;
            if (model.p_ison == 0)
            {
                strText = "*填写比分/,比/,开奖模式,截止时间,操作原因,";
                strName = "resultone,resulttwo,iType,oTime,pSms,gid";
                strType = "num,num,select,date,text,hidden";
                strValu = "0'0'1'" + DT.FormatDate(DateTime.Now.AddHours(-10), 0) + "''" + gid + "";
                strEmpt = "false,false,1|正常模式|2|截时模式|3|平盘模式,true,true,";
            }
            else
            {
                strText = "*填写比分/,比/,开奖模式,截止时间,操作原因," + ub.Get("SiteGqText") + "比分时间(格式2010-10-7 1:00:00#2010-10-7 1:20:00)/,";
                strName = "resultone,resulttwo,iType,oTime,pSms,onceTime,gid";
                strType = "num,num,select,date,text,textarea,hidden";
                strValu = "0'0'1'" + DT.FormatDate(DateTime.Now.AddHours(-10), 0) + "'''" + gid + "";
                strEmpt = "false,false,1|正常模式|2|截时模式|3|平盘模式,true,true,true,";
            }
            string strIdea = "/提示:非正常模式开奖时请输入操作原因;/当选择截时模式时,即该时间前的作正常开奖,时间后的作平盘返还;/当你选择平盘模式时,比分写成0:0即可/";
            string strOthe = "";
            if (model.p_result_one != null && model.p_result_two != null)
            {
                strOthe = "确定重开奖,openGuess.aspx,post,1,red";
            }
            else
            {
                strOthe = "确定开奖,openGuess.aspx,post,1,red";
            }

            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));

            if (model.p_result_one != null && model.p_result_two != null)
            {
                builder.Append(Out.Tab("<div>", "<br />"));
                builder.Append("重要:重开奖系统自动扣回已经兑奖的币并进行新一轮的开奖,如果币不够扣,即自动禁该会员的金融系统并记录<a href=\"" + Utils.getUrl("../default.aspx") + "\">欠币日志</a>");
                builder.Append(Out.Tab("</div>", ""));
            }

            builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
            builder.Append(Out.Tab("<div>", ""));
            if (Utils.GetTopDomain() == "tl88.cc" || Utils.GetTopDomain() == "168yy.cc")
            {
                string stronce = new TPR2.BLL.guess.BaList().Getp_temptimes(gid);
                if (stronce != "")
                {
                    builder.Append("" + ub.Get("SiteGqText") + "比分参考:<br />" + stronce.Replace("|", "<br />") + "");
                }
            }
            builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "返回上一级"));
            builder.Append(Out.Tab("</div>", ""));
            builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
            builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
    }
Example #35
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Master.Title = "清空记录";
        string act = Utils.GetRequest("act", "all", 1, "", "");

        if (act == "actopok")
        {
            if (Utils.GetDomain().Contains("kubao") || Utils.GetDomain().Contains("tuhao") || Utils.GetDomain().Contains("th") || Utils.GetDomain().Contains("kb288") || Utils.GetDomain().Contains("127.0.0.6"))
            {
                int ManageId = new BCW.User.Manage().IsManageLogin();
                if (ManageId != 1 && ManageId != 11)
                {
                    Utils.Error("你的权限不足", "");
                }
                DateTime sTime  = Utils.ParseTime(Utils.GetRequest("sTime", "post", 2, DT.RegexTime, "开始时间填写无效"));
                DateTime oTime  = Utils.ParseTime(Utils.GetRequest("oTime", "post", 2, DT.RegexTime, "结束时间填写无效"));
                int      iTar   = Utils.ParseInt(Utils.GetRequest("iTar", "post", 2, @"^[0-9]\d*$", "返负千分比填写错误"));
                int      iPrice = Utils.ParseInt(Utils.GetRequest("iPrice", "post", 2, @"^[0-9]\d*$", "至少输多少币才返填写错误"));

                DataSet ds = new TPR.BLL.guess.BaPay().GetBaPayList("payusid,sum(p_getMoney-payCent) as payCents", "paytimes>='" + sTime + "'and paytimes<'" + oTime + "' and Types=0 group by payusid");
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    long Cents = Convert.ToInt64(ds.Tables[0].Rows[i]["payCents"]);
                    if (Cents < 0 && Cents < (-iPrice))
                    {
                        int  usid = Convert.ToInt32(ds.Tables[0].Rows[i]["payusid"]);
                        long cent = Convert.ToInt64((-Cents) * (iTar * 0.001));
                        new BCW.BLL.User().UpdateiGold(usid, cent, "竞猜返负");
                        //发内线
                        string strLog = "根据你上期竞猜排行榜上的亏损情况,系统自动返还了" + cent + "" + ub.Get("SiteBz") + "[url=/bbs/guess/default.aspx]进入球彩竞猜[/url]";
                        new BCW.BLL.Guest().Add(0, usid, new BCW.BLL.User().GetUsName(usid), strLog);
                    }
                }

                Utils.Success("返负操作", "返负操作成功", Utils.getUrl("clear.aspx"), "1");
            }
        }
        else if (act == "actopok2")
        {
            if (Utils.GetDomain().Contains("kubao") || Utils.GetDomain().Contains("tuhao") || Utils.GetDomain().Contains("th") || Utils.GetDomain().Contains("kb288") || Utils.GetDomain().Contains("127.0.0.6"))
            {
                int ManageId = new BCW.User.Manage().IsManageLogin();
                if (ManageId != 1 && ManageId != 11)
                {
                    Utils.Error("你的权限不足", "");
                }
                DateTime sTime  = Utils.ParseTime(Utils.GetRequest("sTime", "post", 2, DT.RegexTime, "开始时间填写无效"));
                DateTime oTime  = Utils.ParseTime(Utils.GetRequest("oTime", "post", 2, DT.RegexTime, "结束时间填写无效"));
                int      iTar   = Utils.ParseInt(Utils.GetRequest("iTar", "post", 2, @"^[0-9]\d*$", "返赢千分比填写错误"));
                int      iPrice = Utils.ParseInt(Utils.GetRequest("iPrice", "post", 2, @"^[0-9]\d*$", "至少赢多少币才返填写错误"));

                DataSet ds = new TPR.BLL.guess.BaPay().GetBaPayList("payusid,sum(p_getMoney-payCent) as payCents", "paytimes>='" + sTime + "'and paytimes<'" + oTime + "' and Types=0 group by payusid");
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    long Cents = Convert.ToInt64(ds.Tables[0].Rows[i]["payCents"]);
                    if (Cents > 0 && Cents >= iPrice)
                    {
                        int  usid = Convert.ToInt32(ds.Tables[0].Rows[i]["payusid"]);
                        long cent = Convert.ToInt64(Cents * (iTar * 0.001));
                        new BCW.BLL.User().UpdateiGold(usid, cent, "竞猜返赢");
                        //发内线
                        string strLog = "根据你上期竞猜排行榜上的赢利情况,系统自动返还了" + cent + "" + ub.Get("SiteBz") + "[url=/bbs/guess/default.aspx]进入球彩竞猜[/url]";

                        new BCW.BLL.Guest().Add(0, usid, new BCW.BLL.User().GetUsName(usid), strLog);
                    }
                }

                Utils.Success("返赢操作", "返赢操作成功", Utils.getUrl("clear.aspx"), "1");
            }
        }
        else if (act == "actspaceguess")//清空已截止的、无投注记录的赛事
        {
            int     k  = 0;
            DataSet ds = BCW.Data.SqlHelper.Query("select ID from tb_balist where p_TPRTime<'" + DateTime.Now + "' and p_active=0");
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    int ID = int.Parse(ds.Tables[0].Rows[i]["ID"].ToString());

                    int pCount = new TPR.BLL.guess.BaPay().GetBaPayCount("bcid=" + ID + "");
                    if (pCount == 0)
                    {
                        new TPR.BLL.guess.BaList().Delete(ID);
                        k++;
                    }
                }
            }
            Utils.Success("清空记录", "清空无投注赛事成功", Utils.getUrl("default.aspx"), "1");
        }
        else
        {
            string ac   = Utils.GetRequest("ac", "post", 1, "", "");
            string Info = Utils.GetRequest("Info", "post", 1, "", "");
            if (ac == "清空记录" || ac == Utils.ToTChinese("清空记录"))
            {
                int    Ptype, Ltype, Ttype, iTset;
                string sTime = "";
                string oTime = "";
                Ptype = Utils.ParseInt(Utils.GetRequest("Ptype", "post", 2, @"^[0-2]$", "球类选择无效"));
                Ltype = Utils.ParseInt(Utils.GetRequest("Ltype", "post", 2, @"^[1-9]$", "类型选择无效"));
                Ttype = Utils.ParseInt(Utils.GetRequest("Ttype", "post", 2, @"^[1-5]+$", "限制选择无效"));
                iTset = Utils.ParseInt(Utils.GetRequest("iTset", "post", 2, @"^[1-3]+$", "局域选择无效"));
                if (Ttype == 4)
                {
                    sTime = Utils.GetRequest("sTime", "post", 2, DT.RegexTime, "开始时间填写无效");
                    oTime = Utils.GetRequest("oTime", "post", 2, DT.RegexTime, "结束时间填写无效");
                }

                if (Info == "ok")
                {
                    string cText = string.Empty;
                    if (Ltype == 1)
                    {
                        cText = "清空竞猜排行榜";
                    }
                    else if (Ltype == 2)
                    {
                        cText = "清空竞猜投注记录";
                    }
                    else if (Ltype == 3)
                    {
                        cText = "清空竞猜赛事记录";
                    }
                    else if (Ltype == 4)
                    {
                        cText = "清空竞猜串串记录";
                    }
                    else if (Ltype == 5)
                    {
                        cText = "清空竞猜串串排行榜";
                    }
                    //游戏日志记录
                    int      ManageId  = new BCW.User.Manage().IsManageLogin();
                    int      gid       = new TPR.BLL.guess.BaList().GetMaxId();
                    string[] p_pageArr = { "ac", "Ltype", "Ptype", "Ttype", "sTime", "oTime", "iTset", "Info" };
                    BCW.User.GameLog.GameLogPage(Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号" + cText + "", gid);

                    //组合条件查询
                    string strWhere = "";

                    if (Ltype == 1)//排行榜记录
                    {
                        //------------------------返负彩
                        if (Convert.ToInt32(ub.GetSub("SiteLostPrice", xmlPath)) > 0)
                        {
                            DataSet ds = new TPR.BLL.guess.BaOrder().GetBaOrderList("orderusid,orderusname,orderjbnum", "Orderjbnum < 0 and Orderjbnum <= " + (-Convert.ToInt32(ub.GetSub("SiteLostPrice", xmlPath))) + "");
                            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                            {
                                int cent = Convert.ToInt32((-Convert.ToInt32(ds.Tables[0].Rows[i]["orderjbnum"])) * (Convert.ToDouble(ub.GetSub("SiteLostPL", xmlPath)) * 0.01));

                                //操作币
                                new BCW.BLL.User().UpdateiGold(Convert.ToInt32(ds.Tables[0].Rows[i]["orderusid"]), cent, "");
                                //发内线
                                string strLog = "根据你上期竞猜排行榜上的盈利情况,系统自动返还了" + cent + "" + ub.Get("SiteBz") + "[url=/bbs/guess/default.aspx]进入球彩竞猜[/url]";

                                new BCW.BLL.Guest().Add(0, Convert.ToInt32(ds.Tables[0].Rows[i]["orderusid"]), ds.Tables[0].Rows[i]["orderusname"].ToString(), strLog);
                            }
                        }
                        //------------------------返负彩
                        new TPR.BLL.guess.BaOrder().DeleteStr();
                    }
                    else if (Ltype == 2)//投注记录
                    {
                        if (Ptype != 0)
                        {
                            strWhere += "pType=" + Ptype + " ";
                        }
                        else
                        {
                            strWhere += "pType>0 ";
                        }

                        if (Ttype == 1)
                        {
                            strWhere += "and paytimes='" + DateTime.Now.ToLongDateString() + "'";
                        }
                        else if (Ttype == 2)
                        {
                            strWhere += "and paytimes>='" + DateTime.Now.AddDays(-7) + "'";
                        }
                        else if (Ttype == 3)
                        {
                            strWhere += "and paytimes>='" + DateTime.Now.AddDays(-30) + "'";
                        }
                        else if (Ttype == 4)
                        {
                            if (iTset == 1)
                            {
                                strWhere += "and paytimes>='" + sTime + "' and paytimes<='" + oTime + "'";
                            }
                            else if (iTset == 2)
                            {
                                strWhere += "and paytimes>'" + sTime + "' and paytimes<'" + oTime + "'";
                            }
                            else if (iTset == 3)
                            {
                                strWhere += "and paytimes NOT BETWEEN '" + sTime + "' and '" + oTime + "'";
                            }
                        }
                        new TPR.BLL.guess.BaPay().DeleteStr(strWhere);
                    }
                    else if (Ltype == 3)//赛事记录
                    {
                        if (Ptype != 0)
                        {
                            strWhere += "p_type=" + Ptype + " ";
                        }
                        else
                        {
                            strWhere += "p_type>0 ";
                        }

                        if (Ttype == 1)
                        {
                            strWhere += "and p_addtime='" + DateTime.Now.ToLongDateString() + "'";
                        }
                        else if (Ttype == 2)
                        {
                            strWhere += "and p_addtime>='" + DateTime.Now.AddDays(-7) + "'";
                        }
                        else if (Ttype == 3)
                        {
                            strWhere += "and p_addtime>='" + DateTime.Now.AddDays(-30) + "'";
                        }
                        else if (Ttype == 4)
                        {
                            if (iTset == 1)
                            {
                                strWhere += "and p_addtime>='" + sTime + "' and p_addtime<='" + oTime + "'";
                            }
                            else if (iTset == 2)
                            {
                                strWhere += "and p_addtime>'" + sTime + "' and p_addtime<'" + oTime + "'";
                            }
                            else if (iTset == 3)
                            {
                                strWhere += "and p_addtime NOT BETWEEN '" + sTime + "' and '" + oTime + "'";
                            }
                        }

                        new TPR.BLL.guess.BaList().DeleteStr(strWhere);
                    }
                    else if (Ltype == 4)//串串记录
                    {
                        if (Ttype == 1)
                        {
                            strWhere += "AddTime='" + DateTime.Now.ToLongDateString() + "'";
                        }
                        else if (Ttype == 2)
                        {
                            strWhere += "AddTime>='" + DateTime.Now.AddDays(-7) + "'";
                        }
                        else if (Ttype == 3)
                        {
                            strWhere += "AddTime>='" + DateTime.Now.AddDays(-30) + "'";
                        }
                        else if (Ttype == 4)
                        {
                            if (iTset == 1)
                            {
                                strWhere += "AddTime>='" + sTime + "' and AddTime<='" + oTime + "'";
                            }
                            else if (iTset == 2)
                            {
                                strWhere += "AddTime>'" + sTime + "' and AddTime<'" + oTime + "'";
                            }
                            else if (iTset == 3)
                            {
                                strWhere += "AddTime NOT BETWEEN '" + sTime + "' and '" + oTime + "'";
                            }
                        }
                        new TPR.BLL.guess.Super().DeleteStr(strWhere);
                    }

                    else if (Ltype == 5)//串串排行榜
                    {
                        new TPR.BLL.guess.SuperOrder().DeleteStr();
                    }
                    Utils.Success("清空记录", "清空记录成功", Utils.getUrl("clear.aspx"), "1");
                }
                else
                {
                    builder.Append(Out.Tab("<div class=\"title\">", ""));
                    if (Ltype == 1)
                    {
                        builder.Append("请确认清空排行榜,清空的同时将返负彩,负彩相关设置请在系统参数中配置");
                    }
                    else if (Ltype == 2)
                    {
                        builder.Append("请确认清空投注记录");
                    }
                    else if (Ltype == 3)
                    {
                        builder.Append("请确认清空赛事记录");
                    }
                    else if (Ltype == 4)
                    {
                        builder.Append("请确认清空串串记录");
                    }
                    else if (Ltype == 5)
                    {
                        builder.Append("请确认清空串串排行榜");
                    }

                    builder.Append(Out.Tab("</div>", "<br />"));
                    string strName = "Ltype,Ptype,Ttype,sTime,oTime,iTset,Info";
                    string strValu = "" + Ltype + "'" + Ptype + "'" + Ttype + "'" + sTime + "'" + oTime + "'" + iTset + "'ok";
                    string strOthe = "清空记录,clear.aspx,post,1,red";

                    builder.Append(Out.wapform(strName, strValu, strOthe));
                    builder.Append(Out.Tab("<div>", "<br />"));
                    builder.Append(Out.waplink(Utils.getUrl("clear.aspx"), "先留着吧.."));
                    builder.Append(Out.Tab("</div>", "<br />"));
                }
            }
            else if (act == "actop")
            {
                builder.Append(Out.Tab("<div class=\"title\">", ""));
                builder.Append("返负点操作");
                builder.Append(Out.Tab("</div>", ""));
                string strText = "开始时间:,结束时间:,返负千分比:,至少输多少才返:,";
                string strName = "sTime,oTime,iTar,iPrice,act";
                string strType = "date,date,num,num,hidden";
                string strValu = "" + DT.FormatDate(DateTime.Now.AddDays(-10), 0) + "'" + DT.FormatDate(DateTime.Now, 0) + "'''actopok";
                string strEmpt = "false,false,false,false,false";
                string strIdea = "/";
                string strOthe = "马上返负,clear.aspx,post,1,red";

                builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
                builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
                builder.Append(Out.Tab("<div>", ""));
                builder.Append(Out.waplink(Utils.getUrl("default.aspx"), "返回上一级"));
                builder.Append(Out.Tab("</div>", ""));
                builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
                builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
                builder.Append(Out.Tab("</div>", "<br />"));
            }
            else if (act == "actop2")
            {
                builder.Append(Out.Tab("<div class=\"title\">", ""));
                builder.Append("返赢点操作");
                builder.Append(Out.Tab("</div>", ""));
                string strText = "开始时间:,结束时间:,返赢千分比:,至少赢多少才返:,";
                string strName = "sTime,oTime,iTar,iPrice,act";
                string strType = "date,date,num,num,hidden";
                string strValu = "" + DT.FormatDate(DateTime.Now.AddDays(-10), 0) + "'" + DT.FormatDate(DateTime.Now, 0) + "'''actopok2";
                string strEmpt = "false,false,false,false,false";
                string strIdea = "/";
                string strOthe = "马上返赢,clear.aspx,post,1,red";

                builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
                builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
                builder.Append(Out.Tab("<div>", ""));
                builder.Append(Out.waplink(Utils.getUrl("default.aspx"), "返回上一级"));
                builder.Append(Out.Tab("</div>", ""));
                builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
                builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
                builder.Append(Out.Tab("</div>", "<br />"));
            }
            else
            {
                builder.Append(Out.Tab("<div class=\"title\">", ""));
                builder.Append("清空历史记录");
                builder.Append(Out.Tab("</div>", ""));
                string strText = "*选择清空内容:/,球类:,限制:,开始时间:,结束时间:,时间局域:";
                string strName = "Ltype,Ptype,Ttype,sTime,oTime,iTset";
                string strType = "select,select,select,date,date,select";
                string strValu = "1'0'5'" + DT.FormatDate(DateTime.Now.AddDays(-10), 0) + "'" + DT.FormatDate(DateTime.Now, 0) + "'1";
                string strEmpt = "1|排行榜记录|2|投注记录|3|赛事记录|4|串串记录|5|串串排行榜,0|全部|1|足球|2|篮球,1|今天所有|2|一个星期|3|一个月内|4|指定时间|5|所有时间,true,true,1|=&lt;&gt;=两者之间|2|&lt;&gt;介负于两者|3|=&gt;&lt;=两者之外";
                string strIdea = "/温馨提示:选择限定时间需填写时间类型;/排行榜记录不用选择时间限制;/闲聊、消费记录不用选择球类/";
                string strOthe = "清空记录,clear.aspx,post,1,red";

                builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
                builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
                builder.Append(Out.Tab("<div>", ""));
                if (Utils.GetDomain().Contains("kubao") || Utils.GetDomain().Contains("tuhao") || Utils.GetDomain().Contains("th") || Utils.GetDomain().Contains("kb288") || Utils.GetDomain().Contains("127.0.0.6"))
                {
                    builder.Append("<a href=\"" + Utils.getUrl("clear.aspx?act=actop") + "\">返负点操作</a><br />");
                    builder.Append("<a href=\"" + Utils.getUrl("clear.aspx?act=actop2") + "\">返赢点操作</a><br />");
                }
                builder.Append(Out.waplink(Utils.getUrl("default.aspx"), "返回上一级"));
                builder.Append(Out.Tab("</div>", ""));
                builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
                builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
                builder.Append(Out.Tab("</div>", "<br />"));
            }
        }
    }
Example #36
0
 public bool updateDTBBL(DT dt)
 {
     return(dal.editDT(dt));
 }
Example #37
0
    private void EditPage()
    {
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "红包群ID错误"));

        Master.Title = "编辑红包群";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("编辑红包群");
        builder.Append(Out.Tab("</div>", ""));
        BCW.Model.Chat model = new BCW.BLL.Chat().GetChat(id);
        if (model == null)
        {
            Utils.Error("不存在的红包群", "");
        }
        string ExTime = model.ExTime.ToString();

        if (DT.FormatDate(model.ExTime, 0) == "1990-01-01 00:00:00")
        {
            ExTime = "0";
        }
        string strText = "红包群名称:/,红包群主题(200字内):/,室主ID(多个用#分隔):/,见习室主ID(多个用#分隔):/,临管(多个用#分隔):/,红包群底部UBB:/,红包群基金:/,基金密码:/,最高在线:/,红包群积分:/,创建ID:/,关联城市ID:/,红包群类型:/,红包群密码(自建类型有效):/,抢币词语(15字内):/,抢币整点随机值(格式如10-20):/,抢币非整点随机值(格式如1-5):/,抢币循环时间(秒):/,排序:/,创建时间:/,过期时间(永不过期请填写0):/,,,";
        string strName = "ChatName,ChatNotes,ChatSZ,ChatJS,ChatLG,ChatFoot,ChatCent,CentPwd,ChatTopLine,ChatScore,UsID,GroupId,Types,ChatPwd,ChatCT,ChatCbig,ChatCsmall,ChatCon,Paixu,AddTime,ExTime,id,act,backurl";
        string strType = "text,text,text,text,text,textarea,num,text,num,text,num,num,select,text,text,text,text,num,snum,date,date,hidden,hidden,hidden";
        string strValu = "" + model.ChatName + "'" + model.ChatNotes + "'" + model.ChatSZ + "'" + model.ChatJS + "'" + model.ChatLG + "'" + model.ChatFoot + "'" + model.ChatCent + "'" + model.CentPwd + "'" + model.ChatTopLine + "'" + Convert.ToDouble(model.ChatScore) + "'" + model.UsID + "'" + model.GroupId + "'" + model.Types + "'" + model.ChatPwd + "'" + model.ChatCT + "'" + model.ChatCbig + "'" + model.ChatCsmall + "'" + model.ChatCon + "'" + model.Paixu + "'" + DT.FormatDate(model.AddTime, 0) + "'" + ExTime + "'" + id + "'editsave'" + Utils.getPage(0) + "";
        string strEmpt = "false,true,true,true,true,true,false,true,false,false,false,false,0|主题红包群|1|圈子红包群|2|同城红包群|3|自建红包群,true,true,true,true,false,false,false,false,false,false,false";
        string strIdea = "/";
        string strOthe = "编辑红包群|reset,chat.aspx,post,1,red|blue";

        builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        builder.Append(Out.Tab("<div>", "<br />"));
        builder.Append("温馨提示:<br />抢币词语如:“我要抢币”,限15字内.<br />当会员整点抢币时,系统自动调用整点随机值随机奖币,反之随机非整点值<br />抢币词语不为空与抢币循环时间不为0时将启用该红包群的抢币功能");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getPage("chat.aspx") + "\">返回上一级</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=del&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">删除此红包群</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
 public static extern int DrawTextW(Gdi32.HDC hdc, string lpchText, int nCount, ref RECT lprc, DT format);
Example #39
0
 public void Should_Serialize_yyyyMM()
 {
     var date = new DT(2015, 4);
     Assert.AreEqual("201504", date.Value);
 }
Example #40
0
    private void EditSavePage()
    {
        int ManageId = new BCW.User.Manage().IsManageLogin();

        if (ManageId != 1)
        {
            Utils.Error("此功能暂停开放", "");
        }
        int      id          = int.Parse(Utils.GetRequest("id", "post", 2, @"^[1-9]\d*$", "红包群ID错误"));
        string   ChatName    = Utils.GetRequest("ChatName", "post", 2, @"^[^\^]{1,20}$", "聊天名称限20字内");
        string   ChatNotes   = Utils.GetRequest("ChatNotes", "post", 3, @"^[^\^]{1,200}$", "红包群主题限200字内,可留空");
        string   ChatSZ      = Utils.GetRequest("ChatSZ", "post", 3, @"^[0-9]{1,10}(?:\#[0-9]{1,10}){0,500}$", "室主ID多个请用#分隔,可留空");
        string   ChatJS      = Utils.GetRequest("ChatJS", "post", 3, @"^[0-9]{1,10}(?:\#[0-9]{1,10}){0,500}$", "见习室主ID多个请用#分隔,可留空");
        string   ChatLG      = Utils.GetRequest("ChatLG", "post", 3, @"^[0-9]{1,10}(?:\#[0-9]{1,10}){0,500}$", "临管ID多个请用#分隔,可留空");
        string   ChatFoot    = Utils.GetRequest("ChatFoot", "post", 3, @"^[^\^]{1,2000}$", "红包群底部UBB限2000字内,可留空");
        int      ChatCent    = int.Parse(Utils.GetRequest("ChatCent", "post", 2, @"^[0-9]\d*$", "红包群基金填写错误"));
        string   CentPwd     = Utils.GetRequest("CentPwd", "post", 3, @"^[A-Za-z0-9]{4,20}$", "基金密码限4-20位,必须由字母或数字组成");
        int      ChatTopLine = int.Parse(Utils.GetRequest("ChatTopLine", "post", 2, @"^[0-9]\d*$", "最高在线人数填写错误"));
        int      ChatScore   = int.Parse(Utils.GetRequest("ChatScore", "post", 2, @"^[0-9]\d*$", "红包群积分填写错误"));
        int      UsID        = int.Parse(Utils.GetRequest("UsID", "post", 2, @"^[0-9]\d*$", "创建ID填写错误"));
        int      GroupId     = int.Parse(Utils.GetRequest("GroupId", "post", 2, @"^[0-9]\d*$", "关联ID填写错误"));
        int      Types       = int.Parse(Utils.GetRequest("Types", "post", 2, @"^[0-3]$", "类型选择错误"));
        string   ChatPwd     = Utils.GetRequest("ChatPwd", "post", 3, @"^[A-Za-z0-9]{1,20}$", "红包群密码限1-20位,必须由字母或数字组成,可留空");
        string   ChatCT      = Utils.GetRequest("ChatCT", "post", 3, @"^[A-Za-z\u4e00-\u9fa5]{1,15}$", "抢币词语10字内,不能使用特殊符号,可留空");
        string   ChatCbig    = Utils.GetRequest("ChatCbig", "post", 3, @"^[1-9]\d*-[1-9]\d*$", "抢币整点随机值填写格式10-20,不开放抢币请留空");
        string   ChatCsmall  = Utils.GetRequest("ChatCsmall", "post", 3, @"^[1-9]\d*-[1-9]\d*$", "抢币非整点随机值填写格式1-5,不开放抢币请留空");
        int      ChatCon     = int.Parse(Utils.GetRequest("ChatCon", "post", 2, @"^[0-9]\d*$", "循环时间必须为数字,不开放抢币请填写0"));
        int      Paixu       = int.Parse(Utils.GetRequest("Paixu", "post", 2, @"^[0-9]\d*$", "排序必须为数字"));
        DateTime AddTime     = Utils.ParseTime(Utils.GetRequest("AddTime", "post", 2, DT.RegexTime, "创建时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + ""));
        string   sExTime     = Utils.GetRequest("ExTime", "post", 1, "", "");
        DateTime ExTime      = DateTime.Parse("1990-01-01 00:00:00");

        if (sExTime != "0")
        {
            ExTime = Utils.ParseTime(Utils.GetRequest("ExTime", "post", 2, DT.RegexTime, "过期时间填写错误,永不过期请填写0"));
        }

        //抢币随机值判断
        if (ChatCbig != "" && ChatCsmall != "")
        {
            string[] Cbig = ChatCbig.Split("-".ToCharArray());
            if (Convert.ToInt32(Cbig[0]) >= Convert.ToInt32(Cbig[1]))
            {
                Utils.Error("抢币整点随机值填写格式10-20,不开放抢币请留空", "");
            }
            string[] Csmall = ChatCsmall.Split("-".ToCharArray());
            if (Convert.ToInt32(Csmall[0]) >= Convert.ToInt32(Csmall[1]))
            {
                Utils.Error("抢币非整点随机值填写格式1-5,不开放抢币请留空", "");
            }
        }
        BCW.Model.Chat m = new BCW.BLL.Chat().GetChat(id);
        if (m == null)
        {
            Utils.Error("不存在的红包群", "");
        }
        if (UsID > 0)
        {
            if (!new BCW.BLL.User().Exists(UsID))
            {
                Utils.Error("不存在的创建ID", "");
            }
        }
        if (Types == 3 && sExTime == "0")
        {
            Utils.Error("选择自建类型时,过期时间不能填写0", "");
        }
        string getChatPwd = new BCW.BLL.Chat().GetChatPwd(id);

        if (getChatPwd != ChatPwd)
        {
            new BCW.BLL.Chat().UpdatePwdID(id, "");//清空进入的ID标识
        }
        //抢币标识
        string sCTemp = string.Empty;

        if (ChatCT != m.ChatCT)
        {
            string   CText = Utils.ConvertSeparated(ChatCT, 1, "#");
            string[] CTemp = CText.Split("#".ToCharArray());
            for (int i = 0; i < CTemp.Length; i++)
            {
                sCTemp += "#0";
            }
            sCTemp = Utils.Mid(sCTemp, 1, sCTemp.Length);
        }
        else
        {
            sCTemp = m.ChatCId;
        }

        BCW.Model.Chat model = new BCW.Model.Chat();
        model.ID          = id;
        model.ChatName    = ChatName;
        model.ChatNotes   = ChatNotes;
        model.ChatSZ      = ChatSZ;
        model.ChatJS      = ChatJS;
        model.ChatLG      = ChatLG;
        model.ChatFoot    = ChatFoot;
        model.ChatCent    = ChatCent;
        model.CentPwd     = CentPwd;
        model.ChatTopLine = ChatTopLine;
        model.ChatScore   = ChatScore;
        model.UsID        = UsID;
        model.GroupId     = GroupId;
        model.Types       = Types;
        model.ChatPwd     = ChatPwd;
        model.ChatCT      = ChatCT;
        model.ChatCbig    = ChatCbig;
        model.ChatCsmall  = ChatCsmall;
        model.ChatCId     = sCTemp;//初始化抢币
        model.ChatCon     = ChatCon;
        model.Paixu       = Paixu;
        model.AddTime     = AddTime;
        model.ExTime      = ExTime;
        new BCW.BLL.Chat().Update(model);
        Utils.Success("编辑红包群", "编辑红包群成功..", Utils.getUrl("chat.aspx?act=edit&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + ""), "1");
    }
Example #41
0
 public static extern int DrawTextEx(IntPtr hdc, StringBuilder lpchText, int cchText,
     ref RECT lprc, DT dwDTFormat, ref DRAWTEXTPARAMS lpDTParams);
Example #42
0
    private void FriendPage(string act)
    {
        int meid = new BCW.User.Users().GetUsId();

        if (meid == 0)
        {
            Utils.Login();
        }

        int hid = int.Parse(Utils.GetRequest("hid", "get", 2, @"^[1-9]\d*$", "0"));

        if (hid == 0)
        {
            hid = meid;
        }

        string NameType = string.Empty;
        string sTitle   = string.Empty;

        if (hid == meid)
        {
            NameType = "我";
        }
        else
        {
            NameType = "TA";
        }

        if (act == "fans")
        {
            sTitle = "关注的友友";
        }
        else if (act == "friend")
        {
            sTitle = "的好友动态";
        }
        else
        {
            sTitle = "的动态记录";
        }

        Master.Title = "" + NameType + "" + sTitle + "";
        builder.Append(Out.Tab("<div class=\"title\">" + NameType + "" + sTitle + "</div>", ""));
        builder.Append(Out.Tab("<div class=\"text\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?hid=" + hid + "") + "\">留言</a>|");
        builder.Append("<a href=\"" + Utils.getUrl("visit.aspx?act=list&amp;ptype=1&amp;hid=" + hid + "") + "\">拜访</a>|");
        builder.Append("<a href=\"" + Utils.getUrl("visit.aspx?act=list&amp;ptype=2&amp;hid=" + hid + "") + "\">访客</a>|");
        if (act == "friend")
        {
            builder.Append("好友|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("action.aspx?act=friend&amp;hid=" + hid + "") + "\">好友</a>|");
        }

        if (meid == hid)
        {
            if (act == "fans")
            {
                builder.Append("关注");
                builder.Append("<br /><a href=\"" + Utils.getUrl("friend.aspx?act=fans&amp;backurl=" + Utils.PostPage(1) + "") + "\">管理我关注的友友</a>");
            }
            else
            {
                builder.Append("<a href=\"" + Utils.getUrl("action.aspx?act=fans&amp;hid=" + hid + "") + "\">关注</a>");
            }
        }
        else
        {
            if (act == "me")
            {
                builder.Append("动态");
            }
            else
            {
                builder.Append("<a href=\"" + Utils.getUrl("action.aspx?act=me&amp;hid=" + hid + "") + "\">动态</a>");
            }
        }

        builder.Append(Out.Tab("</div>", "<br />"));

        int pageIndex;
        int recordCount;
        int pageSize = Convert.ToInt32(ub.Get("SiteListNo"));

        string[] pageValUrl = { "act", "hid", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        int Types = 0;

        if (act == "fans")
        {
            Types = 2;
        }

        // 开始读取列表
        IList <BCW.Model.Action> listAction = null;

        if (act == "me")
        {
            listAction = new BCW.BLL.Action().GetActions(pageIndex, pageSize, "usid=" + hid + " and notes not like '%guess2%' and notes not like '%bbsshop%' ", out recordCount);
        }
        else
        {
            listAction = new BCW.BLL.Action().GetActionsFriend(Types, hid, pageIndex, pageSize, out recordCount);
        }

        if (listAction.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Action n in listAction)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }
                builder.AppendFormat("{0}前<a href=\"" + Utils.getUrl("uinfo.aspx?uid={1}&amp;backurl=" + Utils.PostPage(1) + "") + "\">{2}</a>{3}", DT.DateDiff2(DateTime.Now, n.AddTime), n.UsId, n.UsName, Out.SysUBB(n.Notes));
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getPage("uinfo.aspx") + "\">上级</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Example #43
0
    private void CentListPage()
    {
        int forumid = int.Parse(Utils.GetRequest("forumid", "get", 1, @"^[0-9]\d*$", "0"));

        string Title = string.Empty;
        int    hid   = int.Parse(Utils.GetRequest("hid", "all", 1, @"^[0-9]\d*$", "0"));

        if (hid > 0)
        {
            Title = new BCW.BLL.User().GetUsName(hid);
            if (Title == "")
            {
                Utils.Error("不存在的会员记录", "");
            }

            Title = "<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + hid + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + Title + "(" + hid + ")</a>";
        }
        else
        {
            Title = new BCW.BLL.Forum().GetTitle(forumid);
        }

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("" + Title + "-奖励记录");
        builder.Append(Out.Tab("</div>", "<br />"));

        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = string.Empty;
        string strOrder = string.Empty;

        string[] pageValUrl = { "act", "forumid", "hid", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        if (hid > 0)
        {
            strWhere = "UsID=" + hid + "";
        }
        else
        {
            strWhere = "ForumId=" + forumid + "";
        }

        // 开始读取列表
        IList <BCW.Model.Forumvotelog> listForumvotelog = new BCW.BLL.Forumvotelog().GetForumvotelogs(pageIndex, pageSize, strWhere, out recordCount);

        if (listForumvotelog.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Forumvotelog n in listForumvotelog)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }
                builder.Append("" + ((pageIndex - 1) * pageSize + k) + ".");
                if (hid == 0)
                {
                    builder.Append("奖励会员:<a href=\"" + Utils.getUrl("../uinfo.aspx?uid=" + n.UsID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + n.UsName + "</a><br />");
                }
                builder.Append("主题:<a href=\"" + Utils.getUrl("/bbs/topic.aspx?forumid=" + n.ForumId + "&amp;bid=" + n.BID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + n.Title + "</a>(" + DT.FormatDate(n.AddTime, 1) + ")");
                builder.Append("<br />" + n.Notes);
                builder.Append("<a href=\"" + Utils.getUrl("Gsadmin.aspx?act=editcent&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">【编辑】</a>");

                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.ForumMultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", " "));
        builder.Append("<a href=\"" + Utils.getPage("Gsadmin.aspx?act=cent") + "\">返回上级</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">应用中心</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Example #44
0
    private void ReloadPage()
    {
        int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[0-9]\d*$", "0"));

        Master.Title = "大家都在忙啥呢";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("大家都在忙啥呢");
        builder.Append(Out.Tab("</div>", "<br />"));
        int pageIndex;
        int recordCount;
        int pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        ///取消显示球赛动态
        string strWhere = "(Types <> 5) AND (Types <> 23) ";

        string[] pageValUrl = { "ptype", "uid", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        if (ptype > 0)
        {
            if (ptype == 999)
            {
                strWhere = "(Types=999 or Types=997 or Types=998)";
            }
            else
            {
                strWhere = "Types=" + ptype + "";
            }
        }

        //指定不显示609 中介充值的商品
        strWhere += "AND (NodeId <> 609)";

        // 开始读取列表
        IList <BCW.Model.Action> listAction = new BCW.BLL.Action().GetActions(pageIndex, pageSize, strWhere, out recordCount);

        if (listAction.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Action n in listAction)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }
                if (n.UsId == 0)
                {
                    builder.AppendFormat("{0}前{1}", DT.DateDiff2(DateTime.Now, n.AddTime), Out.SysUBB(n.Notes));
                }
                else
                {
                    builder.AppendFormat("{0}前<a href=\"" + Utils.getUrl("uinfo.aspx?uid={1}&amp;backurl=" + Utils.PostPage(1) + "") + "\">{2}</a>{3}", DT.DateDiff2(DateTime.Now, n.AddTime), n.UsId, n.UsName, Out.SysUBB(n.Notes));
                }
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getPage("uinfo.aspx") + "\">上级</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Example #45
0
    /// <summary>
    /// 跑马自动游戏程序
    /// </summary>
    /// <param name="HorseId">局数ID</param>
    /// <param name="dt">截止时间</param>
    private void ChangePalyHorse()
    {
        BCW.Model.Game.Horselist horse = null;
        new BCW.User.Game.Horse().HorsePage();
        horse = new BCW.BLL.Game.Horselist().GetHorselist();
        int  HorseId = horse.ID;
        long Sec     = DT.DateDiff(horse.EndTime, DateTime.Now, 4);

        if (HorseId > 0)
        {
            int UsIDNum = new BCW.BLL.Game.Horsepay().GetCount(HorseId);//当期下注ID数

            //如果小于15个则自在不同秒数中自动出动1个ID来下注
            if (UsIDNum < 5)
            {
                bool IsPlay = false;
                Sec = 480 - Sec;

                int ZD = 0;
                if (Sec > 5 && Sec <= 30 && Utils.ParseInt(ub.GetSub("HorseZD1", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 1;
                }
                if (Sec > 30 && Sec <= 60 && Utils.ParseInt(ub.GetSub("HorseZD2", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 2;
                }
                else if (Sec > 60 && Sec <= 90 && Utils.ParseInt(ub.GetSub("HorseZD3", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 3;
                }
                else if (Sec > 90 && Sec <= 120 && Utils.ParseInt(ub.GetSub("HorseZD4", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 4;
                }
                else if (Sec > 120 && Sec <= 150 && Utils.ParseInt(ub.GetSub("HorseZD5", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 5;
                }
                else if (Sec > 150 && Sec <= 180 && Utils.ParseInt(ub.GetSub("HorseZD6", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 6;
                }
                else if (Sec > 180 && Sec <= 210 && Utils.ParseInt(ub.GetSub("HorseZD7", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 7;
                }
                else if (Sec > 210 && Sec <= 240 && Utils.ParseInt(ub.GetSub("HorseZD8", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 8;
                }
                else if (Sec > 240 && Sec <= 270 && Utils.ParseInt(ub.GetSub("HorseZD9", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 9;
                }
                else if (Sec > 270 && Sec <= 300 && Utils.ParseInt(ub.GetSub("HorseZD10", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 10;
                }
                else if (Sec > 300 && Sec <= 330 && Utils.ParseInt(ub.GetSub("HorseZD11", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 11;
                }
                else if (Sec > 330 && Sec <= 360 && Utils.ParseInt(ub.GetSub("HorseZD12", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 12;
                }
                else if (Sec > 360 && Sec <= 390 && Utils.ParseInt(ub.GetSub("HorseZD13", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 13;
                }
                else if (Sec > 390 && Sec <= 420 && Utils.ParseInt(ub.GetSub("HorseZD14", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 14;
                }
                else if (Sec > 420 && Sec <= 450 && Utils.ParseInt(ub.GetSub("HorseZD15", xmlPath)) == 0)
                {
                    IsPlay = true;
                    ZD     = 15;
                }

                if (IsPlay)
                {
                    //更新某分钟已出动过
                    ub xml = new ub();
                    xml.ReloadSub(xmlPath); //加载配置
                    xml.dss["HorseZD" + ZD + ""] = 1;

                    System.IO.File.WriteAllText(HttpContext.Current.Server.MapPath(xmlPath), xml.Post(xml.dss), System.Text.Encoding.UTF8);
                    //进行自动下注
                    PlayHorse(HorseId);
                }
            }
        }
    }
Example #46
0
    public void Open()
    {
        if (new BCW.Baccarat.BLL.BJL_Play().Exists())
        {
            //派奖
            DataSet ds = new BCW.Baccarat.BLL.BJL_Play().GetList("*", "HunterPoint='' AND type=0 ORDER BY ID ASC");
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                #region
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    int RoomID     = int.Parse(ds.Tables[0].Rows[i]["RoomID"].ToString());
                    int Play_Table = int.Parse(ds.Tables[0].Rows[i]["Play_Table"].ToString());
                    int ID         = int.Parse(ds.Tables[0].Rows[i]["ID"].ToString());

                    //查询是否已开奖
                    BCW.Baccarat.Model.BJL_Play aa = new BCW.Baccarat.BLL.BJL_Play().GetBJL_Play2(ID);
                    if (aa.type == 0)
                    {
                        //根据房间的桌面查第一个下注的时间
                        DateTime Oldbettime = new BCW.Baccarat.BLL.BJL_Play().GetMinBetTime(RoomID, (Play_Table));
                        if (Oldbettime.AddSeconds((Times + 8)) < DateTime.Now)
                        {
                            BCW.Baccarat.Model.BJL_Card card = new BCW.Baccarat.BLL.BJL_Card().GetCardMessage(RoomID, Play_Table);
                            new BCW.Baccarat.BLL.BJL_Play().update_zd("BankerPoker='" + card.BankerPoker + "',HunterPoker='" + card.HunterPoker + "',BankerPoint=" + card.BankerPoint + ",HunterPoint=" + card.HunterPoint + "", "RoomID=" + RoomID + " and Play_Table=" + (Play_Table) + "");
                            //派奖
                            _price(RoomID, Play_Table);
                            Response.Write("已开奖第" + RoomID + "桌第" + Play_Table + "个房间.ok1<br/>");
                        }
                        else
                        {
                            Response.Write("请等待开奖:第" + RoomID + "桌第" + Play_Table + "个房间准备开奖.还有" + DT.DateDiff(Oldbettime.AddSeconds(Times + 8), DateTime.Now, 4) + "秒.ok1<br/>");
                        }
                    }
                }
                #endregion
            }

            //判断最低下注是否低于彩池,如果是,则封庄
            DataSet ds1 = new BCW.Baccarat.BLL.BJL_Room().GetList("*", "Total_Now<LowTotal and state=0");
            if (ds1 != null && ds1.Tables[0].Rows.Count > 0)
            {
                #region
                for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                {
                    int  ID        = int.Parse(ds1.Tables[0].Rows[i]["ID"].ToString());
                    int  UsID      = int.Parse(ds1.Tables[0].Rows[i]["UsID"].ToString());
                    long LowTotal  = Convert.ToInt64(ds1.Tables[0].Rows[i]["LowTotal"].ToString());
                    long Total_Now = Convert.ToInt64(ds1.Tables[0].Rows[i]["Total_Now"].ToString());
                    if (Total_Now < LowTotal)
                    {
                        new BCW.Baccarat.BLL.BJL_Room().update_zd("state=1", "ID=" + ID + "");
                        if (Total_Now > 0)//退回给庄家
                        {
                            new BCW.BLL.User().UpdateiGold(UsID, new BCW.BLL.User().GetUsName(UsID), Total_Now, "你在" + GameName + "第" + ID + "桌系统自动封庄,系统退还剩余彩池" + Total_Now + ub.Get("SiteBz") + "-标识房间ID" + ID + "");
                            new BCW.BLL.Guest().Add(1, UsID, new BCW.BLL.User().GetUsName(UsID), "你在" + GameName + "第" + ID + "桌系统自动封庄,系统退还剩余彩池" + Total_Now + ub.Get("SiteBz") + ".[url=/bbs/game/bjl.aspx]进入" + GameName + "[/url]");
                        }
                        else
                        {
                            if ((new BCW.BLL.User().GetGold(UsID) + Total_Now) > 0)//够钱扣
                            {
                                new BCW.BLL.User().UpdateiGold(UsID, new BCW.BLL.User().GetUsName(UsID), -Total_Now, "你在" + GameName + "第" + ID + "桌的彩池已低于0,系统自动补扣" + Total_Now + "-标识房间ID" + ID + "");
                                new BCW.BLL.Guest().Add(1, UsID, new BCW.BLL.User().GetUsName(UsID), "你在" + GameName + "第" + ID + "桌的彩池已低于0,系统自动从你账户补扣" + Total_Now + ub.Get("SiteBz") + ".[url=/bbs/game/bjl.aspx]进入" + GameName + "[/url]");
                            }
                            else
                            {
                                BCW.Model.Gameowe owe = new BCW.Model.Gameowe();
                                owe.Types   = 1;
                                owe.UsID    = UsID;
                                owe.UsName  = new BCW.BLL.User().GetUsName(UsID);
                                owe.Content = "你在" + GameName + "第" + ID + "桌的彩池已低于0,你欠下系统的" + (Total_Now + new BCW.BLL.User().GetGold(UsID)) + "" + ub.Get("SiteBz") + ".";
                                owe.OweCent = Total_Now + new BCW.BLL.User().GetGold(UsID);
                                owe.BzType  = 12;//百家乐封庄记录type的id
                                owe.EnId    = ID;
                                owe.AddTime = DateTime.Now;
                                new BCW.BLL.Gameowe().Add(owe);
                                new BCW.BLL.User().UpdateIsFreeze(UsID, 1);

                                //发送内线
                                string strGuess = "你在" + GameName + "第" + ID + "桌的彩池已低于0,你欠下系统的" + (Total_Now + new BCW.BLL.User().GetGold(UsID)) + "" + ub.Get("SiteBz") + ".[br]根据您的帐户数额,实扣" + new BCW.BLL.User().GetGold(UsID) + "" + ub.Get("SiteBz") + ".[br]您的" + ub.Get("SiteBz") + "不足,系统将您帐户冻结。";
                                new BCW.BLL.Guest().Add(1, UsID, new BCW.BLL.User().GetUsName(UsID), strGuess);
                                string bb = "" + new BCW.BLL.User().GetUsName(UsID) + "(" + UsID + ")在" + GameName + "第" + ID + "桌的彩池已低于0,欠下系统" + Total_Now + new BCW.BLL.User().GetGold(UsID) + "" + ub.Get("SiteBz") + ",系统已自动冻结TA的帐户.";
                                new BCW.BLL.Guest().Add(1, 10086, new BCW.BLL.User().GetUsName(10086), bb);
                            }
                        }
                    }
                }
                #endregion
            }

            //超过玩的局数
            DataSet ds2 = new BCW.Baccarat.BLL.BJL_Room().GetList2("*", "a LEFT JOIN tb_BJL_Play b ON a.UsID=b.UsID AND b.Play_Table>=" + RoomTime2 + " AND a.state=0");
            if (ds2 != null && ds2.Tables[0].Rows.Count > 0)
            {
                #region
                for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                {
                    int  ID        = int.Parse(ds2.Tables[0].Rows[i]["ID"].ToString());
                    int  UsID      = int.Parse(ds2.Tables[0].Rows[i]["UsID"].ToString());
                    long LowTotal  = Convert.ToInt64(ds2.Tables[0].Rows[i]["LowTotal"].ToString());
                    long Total_Now = Convert.ToInt64(ds2.Tables[0].Rows[i]["Total_Now"].ToString());

                    new BCW.Baccarat.BLL.BJL_Room().update_zd("state=1", "ID=" + ID + "");
                    if (Total_Now > 0)//退回给庄家
                    {
                        new BCW.BLL.User().UpdateiGold(UsID, new BCW.BLL.User().GetUsName(UsID), Total_Now, "你在" + GameName + "第" + ID + "桌的已达到最高局数,系统自动封庄,退还" + Total_Now + "-标识房间ID" + ID + "");
                        new BCW.BLL.Guest().Add(1, UsID, new BCW.BLL.User().GetUsName(UsID), "你在" + GameName + "第" + ID + "桌的已达到最高局数,系统自动封庄,退还" + Total_Now + ub.Get("SiteBz") + ".[url=/bbs/game/bjl.aspx]进入" + GameName + "[/url]");
                    }
                }
                #endregion
            }
        }
        else
        {
            Response.Write("暂无房间需要开奖.ok1");
        }
    }
Example #47
0
    private void EditSavePage()
    {
        int ManageId = new BCW.User.Manage().IsManageLogin();

        if (ManageId != 1 && ManageId != 9)
        {
            Utils.Error("权限不足", "");
        }
        int      id         = int.Parse(Utils.GetRequest("id", "post", 2, @"^[1-9]\d*$", "ID错误"));
        int      WinNum     = int.Parse(Utils.GetRequest("WinNum", "post", 2, @"^[0-9]\d*$", "开出数字填写错误"));
        DateTime BeginTime  = Utils.ParseTime(Utils.GetRequest("BeginTime", "post", 2, DT.RegexTime, "开盘时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + ""));
        DateTime EndTime    = Utils.ParseTime(Utils.GetRequest("EndTime", "post", 2, DT.RegexTime, "开奖时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + ""));
        int      OutNum     = int.Parse(Utils.GetRequest("OutNum", "post", 2, @"^[0-9]\d*$", "可购买份数填写错误"));
        int      AddNum     = int.Parse(Utils.GetRequest("AddNum", "post", 2, @"^[0-9]\d*$", "已购买份数填写错误"));
        int      iCent      = int.Parse(Utils.GetRequest("iCent", "post", 2, @"^[0-9]\d*$", "每份价格填写错误"));
        int      Odds       = int.Parse(Utils.GetRequest("Odds", "post", 2, @"^[0-9]\d*$", "本期赔率填写错误"));
        long     Pool       = Int64.Parse(Utils.GetRequest("Pool", "post", 4, @"^[0-9]\d*$", "奖池额填写错误"));
        long     BeforePool = Int64.Parse(Utils.GetRequest("BeforePool", "post", 4, @"^[0-9]\d*$", "上期奖池额填写错误"));

        if (!new BCW.BLL.Game.Balllist().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }

        //记录日志
        if (Utils.GetDomain().Contains("kubao") || Utils.GetDomain().Contains("tuhao") || Utils.GetDomain().Contains("th") || Utils.GetDomain().Contains("kb288"))
        {
            String sLogFilePath = System.AppDomain.CurrentDomain.BaseDirectory.ToString() + "/logstr/" + DateTime.Now.ToString("MM-dd") + ".txt";
            LogHelper.Write(sLogFilePath, "操作管理员:" + ManageId + "号/编辑彩球期数:" + id + "|是否预设:" + WinNum + "");
        }

        BCW.Model.Game.Balllist model = new BCW.Model.Game.Balllist();
        model.ID         = id;
        model.WinNum     = WinNum;
        model.BeginTime  = BeginTime;
        model.EndTime    = EndTime;
        model.OutNum     = OutNum;
        model.AddNum     = AddNum;
        model.iCent      = iCent;
        model.Odds       = Odds;
        model.Pool       = Pool;
        model.BeforePool = BeforePool;
        new BCW.BLL.Game.Balllist().Update(model);
        Utils.Success("编辑第" + id + "期", "编辑第" + id + "期成功..", Utils.getUrl("ball.aspx?act=edit&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + ""), "1");
    }
Example #48
0
 public static unsafe extern int DrawTextExW(IntPtr hDC, char* lpszString, int nCount, ref RECT lpRect, DT nFormat, ref DRAWTEXTPARAMS lpDTParams);
Example #49
0
 public static extern int DrawText(IntPtr hdc, string pString, int nCount, ref RECT rect, DT uFormat);
Example #50
0
    /// <summary>
    /// 上传文件
    /// </summary>
    private void SaveFiles(int meid, int forumid, int bid, int reid, out int kk)
    {
        //允许上传数量
        int maxAddNum = Convert.ToInt32(ub.GetSub("UpAddNum", xmlPath));
        int AddNum    = 0;

        if (maxAddNum > 0)
        {
            //计算今天上传数量
            AddNum = new BCW.BLL.Upfile().GetTodayCount(meid);
        }
        //遍历File表单元素
        System.Web.HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;
        //int j = 1;
        int j = files.Count;
        int k = 0;

        try
        {
            string GetFiles = string.Empty;
            for (int iFile = files.Count - 1; iFile > -1; iFile--)
            {
                //检查文件扩展名字
                System.Web.HttpPostedFile postedFile = files[iFile];
                string fileName, fileExtension;
                fileName = System.IO.Path.GetFileName(postedFile.FileName);
                string UpExt = ub.GetSub("UpaFileExt", xmlPath);
                int    UpLength = Convert.ToInt32(ub.GetSub("UpaMaxFileSize", xmlPath));
                if (fileName != "")
                {
                    fileExtension = System.IO.Path.GetExtension(fileName).ToLower();
                    //检查是否允许上传格式
                    if (UpExt.IndexOf(fileExtension) == -1)
                    {
                        continue;
                    }
                    //非法上传
                    if (fileExtension == ".asp" || fileExtension == ".aspx" || fileExtension == ".jsp" || fileExtension == ".php" || fileExtension == ".asa" || fileExtension == ".cer" || fileExtension == ".cdx" || fileExtension == ".htr" || fileExtension == ".exe")
                    {
                        continue;
                    }
                    if (postedFile.ContentLength > Convert.ToInt32(UpLength * 1024))
                    {
                        continue;
                    }
                    string DirPath     = string.Empty;
                    string prevDirPath = string.Empty;
                    string Path        = "/Files/bbs/" + meid + "/act/";
                    string prevPath    = "/Files/bbs/" + meid + "/prev/";
                    int    IsVerify    = 0;
                    if (FileTool.CreateDirectory(Path, out DirPath))
                    {
                        //上传数量限制
                        if (maxAddNum > 0)
                        {
                            if (maxAddNum <= (AddNum + k))
                            {
                                k = -k;
                                if (k == 0)
                                {
                                    k = -999;
                                }
                                break;
                            }
                        }
                        //生成随机文件名
                        fileName = DT.getDateTimeNum() + iFile + fileExtension;
                        string SavePath = System.Web.HttpContext.Current.Request.MapPath(DirPath) + fileName;
                        postedFile.SaveAs(SavePath);

                        //=============================图片木马检测,包括TXT===========================
                        string vSavePath = SavePath;
                        if (fileExtension == ".txt" || fileExtension == ".gif" || fileExtension == ".jpg" || fileExtension == ".jpeg" || fileExtension == "png" || fileExtension == ".bmp")
                        {
                            bool IsPass = true;
                            System.IO.StreamReader sr = new System.IO.StreamReader(vSavePath, System.Text.Encoding.Default);
                            string strContent         = sr.ReadToEnd().ToLower();
                            sr.Close();
                            string str = "system.|request|javascript|script |script>|.getfolder|.createfolder|.deletefolder|.createdirectory|.deletedirectory|.saveas|wscript.shell|script.encode|server.|.createobject|execute|activexobject|language=";
                            foreach (string s in str.Split('|'))
                            {
                                if (strContent.IndexOf(s) != -1)
                                {
                                    System.IO.File.Delete(vSavePath);
                                    IsPass = false;
                                    break;
                                }
                            }
                            if (IsPass == false)
                            {
                                continue;
                            }
                        }
                        //=============================图片木马检测,包括TXT===========================

                        //审核要求指示
                        int Verify = Utils.ParseInt(ub.GetSub("UpIsVerify", xmlPath));
                        //缩略图生成
                        if (fileExtension == ".gif" || fileExtension == ".jpg" || fileExtension == ".jpeg" || fileExtension == "png" || fileExtension == ".bmp")
                        {
                            int ThumbType = Convert.ToInt32(ub.GetSub("UpaThumbType", xmlPath));
                            int width     = Convert.ToInt32(ub.GetSub("UpaWidth", xmlPath));
                            int height    = Convert.ToInt32(ub.GetSub("UpaHeight", xmlPath));
                            if (ThumbType > 0)
                            {
                                try
                                {
                                    bool pbool = false;
                                    if (ThumbType == 1)
                                    {
                                        pbool = true;
                                    }
                                    if (FileTool.CreateDirectory(prevPath, out prevDirPath))
                                    {
                                        string prevSavePath = System.Web.HttpContext.Current.Request.MapPath(prevDirPath) + fileName;

                                        int IsThumb = 0;
                                        if (fileExtension == ".gif")
                                        {
                                            if (ThumbType > 0)
                                            {
                                                new BCW.Graph.GifHelper().GetThumbnail(SavePath, prevSavePath, width, height, pbool);
                                            }

                                            IsThumb = Convert.ToInt32(ub.GetSub("UpaIsThumb", xmlPath));
                                            if (IsThumb > 0)
                                            {
                                                if (IsThumb == 1)
                                                {
                                                    new BCW.Graph.GifHelper().SmartWaterMark(SavePath, "", ub.GetSub("UpaWord", xmlPath), ub.GetSub("UpaWordColor", xmlPath), "Arial", 12, Convert.ToInt32(ub.GetSub("UpaPosition", xmlPath)));//文字水印
                                                }
                                                else
                                                {
                                                    new BCW.Graph.GifHelper().WaterMark(SavePath, "", Server.MapPath(ub.GetSub("UpaWord", xmlPath)), Convert.ToInt32(ub.GetSub("UpaPosition", xmlPath)), Convert.ToInt32(ub.GetSub("UpaTran", xmlPath)));//图片水印
                                                }
                                            }
                                        }
                                        else
                                        {
                                            if (fileExtension == ".gif" || fileExtension == ".jpg" || fileExtension == ".jpeg")
                                            {
                                                if (ThumbType > 0)
                                                {
                                                    new BCW.Graph.ImageHelper().ResizeImage(SavePath, prevSavePath, width, height, pbool);
                                                }
                                                IsThumb = Convert.ToInt32(ub.GetSub("UpaIsThumb", xmlPath));
                                                if (IsThumb > 0)
                                                {
                                                    if (IsThumb == 1)
                                                    {
                                                        new BCW.Graph.ImageHelper().WaterMark(SavePath, "", ub.GetSub("UpaWord", xmlPath), ub.GetSub("UpaWordColor", xmlPath), "Arial", 12, Convert.ToInt32(ub.GetSub("UpaPosition", xmlPath)));//文字水印
                                                    }
                                                    else
                                                    {
                                                        new BCW.Graph.ImageHelper().WaterMark(SavePath, "", Server.MapPath(ub.GetSub("UpaWord", xmlPath)), Convert.ToInt32(ub.GetSub("UpaPosition", xmlPath)), Convert.ToInt32(ub.GetSub("UpaTran", xmlPath)));//图片水印
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                catch { }
                            }

                            //图片审核
                            if (Verify > 0)
                            {
                                IsVerify = 1;
                            }
                        }
                        else
                        {
                            //文件审核
                            if (Verify > 1)
                            {
                                IsVerify = 1;
                            }
                        }

                        string Content = Utils.GetRequest("stext" + j + "", "post", 1, "", "");
                        if (!string.IsNullOrEmpty(Content))
                        {
                            Content = Utils.Left(Content, 30);
                        }
                        else
                        {
                            Content = "";
                        }

                        BCW.Model.Upfile model = new BCW.Model.Upfile();
                        model.Types   = FileTool.GetExtType(fileExtension);
                        model.NodeId  = 0;
                        model.UsID    = meid;
                        model.ForumID = forumid;
                        model.BID     = bid;
                        model.ReID    = reid;
                        model.Files   = DirPath + fileName;
                        if (string.IsNullOrEmpty(prevDirPath))
                        {
                            model.PrevFiles = model.Files;
                        }
                        else
                        {
                            model.PrevFiles = prevDirPath + fileName;
                        }

                        model.Content  = Content;
                        model.FileSize = Convert.ToInt64(postedFile.ContentLength);
                        model.FileExt  = fileExtension;
                        model.DownNum  = 0;
                        model.Cent     = 0;
                        model.IsVerify = IsVerify;
                        model.AddTime  = DateTime.Now;
                        new BCW.BLL.Upfile().Add(model);
                        k++;
                    }
                    //j++;
                    j--;
                }
            }
        }
        catch { }
        kk = k;
    }
Example #51
0
	static void P (DT dt)
	{
		Console.WriteLine ("True");
		dt (new T ());
	}
Example #52
0
 internal static DataType ToDataType(this DT dt)
 {
     return(new DataType(dt));
 }
Example #53
0
    private void IpListPage()
    {
        Master.Title = "查看IP";
        int id    = int.Parse(Utils.GetRequest("id", "get", 1, @"^[0-9]\d*$", "0"));
        int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[0-2]\d*$", "0"));

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        if (id > 0)
        {
            builder.Append(new BCW.BLL.Link().GetLinkName(id));
        }
        builder.Append("IP记录");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"text\">", ""));
        if (ptype == 0)
        {
            builder.Append("全部|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("link.aspx?act=iplist&amp;ptype=0&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">全部</a>|");
        }

        if (ptype == 1)
        {
            builder.Append("链入IP|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("link.aspx?act=iplist&amp;ptype=1&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">链入IP</a>|");
        }

        if (ptype == 2)
        {
            builder.Append("链出IP");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("link.aspx?act=iplist&amp;ptype=2&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">链出IP</a>");
        }

        builder.Append(Out.Tab("</div>", "<br />"));
        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "act", "ptype", "id", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        if (id > 0)
        {
            strWhere += "LinkId=" + id + "";
        }

        if (ptype > 0)
        {
            if (strWhere != "")
            {
                strWhere += " and Types=" + (ptype - 1) + "";
            }
            else
            {
                strWhere += "Types=" + (ptype - 1) + "";
            }
        }
        // 开始读取列表
        IList <BCW.Model.LinkIp> listLinkIp = new BCW.BLL.LinkIp().GetLinkIps(pageIndex, pageSize, strWhere, out recordCount);

        if (listLinkIp.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.LinkIp n in listLinkIp)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }
                string ipCity = new IPSearch().GetAddressWithIP(n.AddUsIP);
                if (!string.IsNullOrEmpty(ipCity))
                {
                    ipCity = ipCity.Replace("IANA保留地址  CZ88.NET", "本机地址").Replace("CZ88.NET", "") + ":";
                }

                builder.Append("[" + ((pageIndex - 1) * pageSize + k) + "]");
                builder.Append(ipCity + "" + n.AddUsIP + "");
                builder.Append("浏览器:" + n.AddUsUA + "");

                if (!string.IsNullOrEmpty(n.AddUsPage))
                {
                    if (n.Types == 0)
                    {
                        builder.Append("来访页:" + Out.UBB(n.AddUsPage) + "");
                    }
                    else
                    {
                        builder.Append("去访页:" + Out.UBB(n.AddUsPage) + "");
                    }
                }
                builder.Append("[" + DT.FormatDate(n.AddTime, 12) + "]");
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div>", "<br />"));
        builder.Append("温馨提示:IP记录只保留当天的记录.");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        if (id > 0)
        {
            builder.Append("<a href=\"" + Utils.getUrl("link.aspx?act=view&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">查看友链</a><br />");
        }
        builder.Append("<a href=\"" + Utils.getPage("link.aspx") + "\">返回上一级</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Example #54
0
 internal static Designer.Inliner ToInliner(this DT dt)
 {
     return((Designer.Inliner)Enum.Parse(typeof(Designer.Inliner),
                                         dt.ToString().Substring(2, dt.ToString().Length - 2), true));
 }
Example #55
0
 public static extern DT nativeCall_PInvoke_Vector3InStruct(DT d);
Example #56
0
 internal static bool IsDefined(this DT dt)
 {
     return(dt != DT.None);
 }
Example #57
0
 static void M(string msg, DT dt)
 {
     System.Console.Write(msg);
     System.Console.WriteLine("true");
     dt(new T());
 }
Example #58
0
 internal static bool IsUserDefinedType(this DT dt)
 {
     return(dt == DT.Udt || dt == DT.Udtt);
 }
Example #59
0
        public void TestEventCollectorWindows()
        {
            var source  = "AsaTests";
            var logname = "AsaTestLogs";

            if (EventLog.SourceExists(source))
            {
                // Delete the source and the log.
                EventLog.DeleteEventSource(source);
                EventLog.Delete(logname);
            }

            // Create the event source to make next try successful.
            EventLog.CreateEventSource(source, logname);

            using EventLog eventLog = new EventLog("Application");
            eventLog.Source         = "Attack Surface Analyzer Tests";
            eventLog.WriteEntry("This Log Entry was created for testing the Attack Surface Analyzer library.", EventLogEntryType.Warning, 101, 1);

            var fsc = new EventLogCollector(new CollectCommandOptions());

            fsc.TryExecute();

            EventLog.DeleteEventSource(source);
            EventLog.Delete(logname);

            Assert.IsTrue(fsc.Results.Any(x => x is EventLogObject ELO && ELO.Source == "Attack Surface Analyzer Tests" && ELO.Timestamp is DateTime DT && DT.AddMinutes(1).CompareTo(DateTime.Now) > 0));
        }
Example #60
0
        public RspSignin UserSignin(ReqSignin _reqData)
        {
            RspSignin _rspData = new RspSignin();

            //验证用户ID格式
            if (_reqData.userId < 0)
            {
                _rspData.header.status     = ERequestResult.faild;
                _rspData.header.statusCode = Error.MOBILE_ERROR_CODE.MOBILE_PARAMS_ERROR;
                return(_rspData);
            }

            //检查是否登录状态
            if (Common.Common.CheckLogin(_reqData.userId, _reqData.userKey) == 0)
            {
                _rspData.header.status     = ERequestResult.faild;
                _rspData.header.statusCode = Error.MOBILE_ERROR_CODE.SYS_USER_NOLOGIN;
                return(_rspData);
            }

            BCW.Model.User model = new BCW.BLL.User().GetSignData(_reqData.userId);
            if (string.IsNullOrEmpty(model.SignTime.ToString()))
            {
                model.SignTime = DateTime.Now.AddDays(-1);
            }
            if (model.SignTime > DateTime.Parse(DateTime.Now.ToLongDateString()))
            {
                _rspData.header.status     = ERequestResult.faild;
                _rspData.header.statusCode = Error.MOBILE_ERROR_CODE.BBS_SIGNIN_HAS_TODAY;
                return(_rspData);
            }
            int SignKeep  = 1;
            int SignTotal = model.SignTotal + 1;

            if (model.SignTime >= DateTime.Parse(DateTime.Now.ToLongDateString()).AddDays(-1))
            {
                SignKeep = model.SignKeep + 1;
            }
            //更新签到信息
            new BCW.BLL.User().UpdateSingData(_reqData.userId, SignTotal, SignKeep);
            _rspData.signinRewardStr = BCW.User.Users.GetWinCent(12, _reqData.userId);

            _rspData.cobi          = new BCW.BLL.User().GetGold(_reqData.userId);
            _rspData.header.status = ERequestResult.success;

            //积分操作
            new BCW.User.Cent().UpdateCent(BCW.User.Cent.enumRole.Cent_Sign, _reqData.userId);

            if (SignKeep % 30 == 0)     //连续签到1个月奖励
            {
                _rspData.monthRewardStr = BCW.User.Users.GetWinCent(14, _reqData.userId);
                //动态记录
                new BCW.BLL.Action().Add(_reqData.userId, "在空间连续一个月签到获得奖励");
                //积分操作
                new BCW.User.Cent().UpdateCent(BCW.User.Cent.enumRole.Cent_Sign3, _reqData.userId);
            }
            else if (SignKeep % 7 == 0)
            {
                _rspData.weekRewardStr = BCW.User.Users.GetWinCent(13, _reqData.userId);

                //动态记录
                new BCW.BLL.Action().Add(_reqData.userId, "在空间连续一周签到获得奖励");
                //积分操作
                new BCW.User.Cent().UpdateCent(BCW.User.Cent.enumRole.Cent_Sign2, _reqData.userId);
            }
            else
            {
                //动态记录
                new BCW.BLL.Action().Add(_reqData.userId, "在空间签到获得奖励");
            }

            _rspData.keepDay  = SignKeep;
            _rspData.totalDay = SignTotal;

            //银行利息更新
            string ForumSet = new BCW.BLL.User().GetForumSet(_reqData.userId);
            object BankTime = BCW.User.Users.GetForumSet2(ForumSet, 10);

            if (BankTime != null)
            {
                int iDay = 1;
                if (ub.GetSub("FinanceBankType", xmlPath) == "0")
                {
                    iDay = 7;
                }
                DateTime getBankTime = Convert.ToDateTime(BankTime);
                if (DT.TwoDateDiff(DateTime.Now, getBankTime) >= iDay)
                {
                    long   iBank   = new BCW.BLL.User().GetBank(_reqData.userId);
                    double iTar    = Convert.ToDouble(ub.GetSub("FinanceBankTar", xmlPath));
                    long   intBank = Convert.ToInt64(iBank * (iTar / 1000));
                    new BCW.BLL.User().UpdateiBank(_reqData.userId, intBank);
                    string GetForumSet = BCW.User.Users.GetForumSetData(ForumSet, DateTime.Now.ToString(), 10);
                    new BCW.BLL.User().UpdateForumSet(_reqData.userId, GetForumSet);
                }
            }

            //VIP成长更新
            BCW.Model.User vip = new BCW.BLL.User().GetVipData(_reqData.userId);
            if (vip != null)
            {
                if (string.IsNullOrEmpty(vip.UpdateDayTime.ToString()) || DT.TwoDateDiff(DateTime.Now, vip.UpdateDayTime) >= 1)
                {
                    if (vip.VipDate > DateTime.Now)
                    {
                        new BCW.BLL.User().UpdateVipGrow(_reqData.userId, vip.VipDayGrow);
                    }
                }
            }


            return(_rspData);
        }