Ejemplo n.º 1
0
        /// <summary>
        /// 下注
        /// </summary>
        /// <param name="code">下注号#注数#玩法ID#元角分#倍数$...</param>
        /// <param name="czid">采种ID</param>
        /// <param name="qihao">期号</param>
        /// <returns></returns>
        public IActionResult Add(string code, int czid, string qihao)
        {
            try
            {
                StringBuilder sb      = new StringBuilder();
                string        userids = "1";//测试用,
                string[]      ss      = code.Split('$');
                foreach (var item in ss)
                {
                    string[]    ss2     = item.Split('#');
                    string      buycode = ss2[0];
                    int         zhushu  = int.Parse(ss2[1]);
                    int         wfid    = int.Parse(ss2[2]);
                    string      yjf     = ss2[3];
                    double      beishu  = double.Parse(ss2[4]);
                    Model.Wanfa wf      = wfdal.GetModel(wfid);
                    if (wf == null)
                    {
                        continue;
                    }
                    double buymoney = wf.basemoney * zhushu * beishu; //下注金额=玩法的基准金额*下注数*下注倍数

                    sb.Append(dal.XiaZhu(userids, buymoney, beishu, qihao, true, wfid, czid) + "<br />");
                }
                return(Json(new { code = 0, msg = sb.ToString() }));
            }
            catch (Exception ex)
            {
                return(Json(new { code = 1, msg = "err : " + ex.Message }));
            }
        }
Ejemplo n.º 2
0
 public ActionResult Add(string buycode, string qihao, string userid)
 {
     try
     {
         double buymoney = 2;
         int    beishu   = 1;
         int    czid     = 23;       //北京PK10
         int    wfid     = 20000101; //猜冠军
         string str      = dal.XiaZhu(userid, buycode, buymoney, beishu, qihao, true, wfid, czid);
         return(Json(new { code = 0, msg = str }));
     }
     catch (Exception ex)
     {
         return(Json(new { code = 1, msg = $"出错:{ex.Message}" }));
     }
 }