Ejemplo n.º 1
0
 private void CalcOpenData()
 {
     Response.Write("【派奖计算】" + "<br/>");
     try
     {
         string cFlag = new PK10().CalcOpenData();
         if (cFlag != "")
         {
             Response.Write("[派奖计算]出错:" + cFlag.Replace("\n", "</br>") + "<br/>");
         }
         else
         {
             Response.Write("派奖完成!");
         }
     }
     catch (Exception ex)
     {
         Response.Write("[派奖计算]出错:" + ex.Message.Replace("\n", "</br>") + "<br/>");
     }
 }
Ejemplo n.º 2
0
    private void OpenRobot()
    {
        #region 取到机器人
        int RobotID = GetRobot();
        if (RobotID == 0)
        {
            Response.Write("没有可用的机器人!!!" + "</br>");
            return;
        }
        string RobotName = new BCW.BLL.User().GetUsName(RobotID);
        #endregion

        #region 更新机器人在线时间
        try
        {
            new BCW.BLL.User().UpdateTime(RobotID, 5);
        }
        catch { }
        #endregion
        //
        #region  注
        PK10_List list = new PK10().GetCurrentSaleData();//取到可下注的期号记录
        if (list == null)
        {
            Response.Write("没有开售记录!" + "</br>");
        }
        else
        {
            PK10_Stutas status = new PK10().GetListStatus(list);
            if (status != PK10_Stutas.在售)
            {
                Response.Write("没有开售记录!" + "</br>");
            }
            else
            {
                Response.Write("第" + list.No.Trim() + "期" + "</br>");
                #region  注
                PK10_Buy buy = CreateBuy(RobotID, RobotName, list);//生成购买记录
                if (buy == null)
                {
                    Response.Write("不能生成购买记录!" + "</br>");
                }
                else
                {
                    Response.Write(buy.BuyDescript + ",每注下:" + buy.BuyPrice.ToString().Trim() + "</br>");
                    #region 付款
                    string cPay = new PK10().Pay(buy, Utils.getPageUrl());
                    if (string.IsNullOrEmpty(cPay))
                    {
                        Response.Write("成功付款!" + "</br>");
                    }
                    else
                    {
                        Response.Write("付款失败...." + "</br>");
                        Response.Write(cPay.Replace("\n", "</br>") + "</br>");
                    }
                    #endregion
                }
                #endregion
            }
        }
        #endregion
        //
        #region 兑奖
        string caseFlag = _logic.CaseRobot(Utils.getPageUrl());
        if (caseFlag == "")
        {
            Response.Write("成功兑奖!" + "</br>");
        }
        else
        {
            Response.Write("兑奖失败...." + "</br>");
            Response.Write(caseFlag.Replace("\n", "</br>") + "</br>");
        }
        #endregion
    }