Exemplo n.º 1
0
        public string DuiJiang(int xiazhuid)
        {
            DAL.WanfaDAL wfdal = new DAL.WanfaDAL()
            {
                ConnStr = ConnStr
            };
            DAL.UserinfoDAL udal = new DAL.UserinfoDAL()
            {
                ConnStr = ConnStr
            };
            DAL.XiazhuinfoDAL xzdal = new DAL.XiazhuinfoDAL()
            {
                ConnStr = ConnStr
            };
            DAL.QihaoinfoDAL qhdal = new DAL.QihaoinfoDAL()
            {
                ConnStr = ConnStr
            };
            DAL.LiushuiDAL lsdal = new DAL.LiushuiDAL()
            {
                ConnStr = ConnStr
            };
            DAL.ShuxingDAL sxdal = new DAL.ShuxingDAL()
            {
                ConnStr = ConnStr
            };


            Model.Xiazhuinfo xz = xzdal.GetModel(xiazhuid);
            if (xz == null)
            {
                throw new Exception("下注记录为空!");
            }
            if (xz.czid != 23)
            {
                throw new Exception("彩种ID不符合!");
            }
            if (!string.IsNullOrEmpty(xz.kjcode))
            {
                throw new Exception("该下注记录已开奖过!");
            }
            if (xz.iszj != 0)
            {
                throw new Exception($"该下注记录状态不对,iszj={xz.iszj}!");
            }
            Model.Userinfo u = udal.GetModel(xz.userid);
            if (u == null)
            {
                throw new Exception("下注用户为空");
            }
            Model.Qihaoinfo qh = qhdal.GetModelByCond($"qihao='{xz.qihao}'");
            if (qh == null)
            {
                throw new Exception("没有当前期信息");
            }
            if (string.IsNullOrEmpty(qh.kjcode))
            {
                throw new Exception("当前期未开奖");
            }

            Model.Wanfa wf = wfdal.GetModel(xz.wfid);


            string return_str = "没有任何结果,请联系程序猿!!!";

            if (wf.wfname.Contains("猜冠军"))
            {
                bool b = new BLL.WanFa.PK10_CaiGuangJun().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney  = u.balance;
                    double zjmoney      = xz.buymoney * wf.peilv;
                    double shouxufee    = 0; //手续费为0
                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //未中奖
                    xz.iszj   = 2;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj={xz.iszj}, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }

            return(return_str);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 兑奖
        /// </summary>
        /// <param name="xiazhuid"></param>
        /// <returns></returns>
        public string DuiJiang(int xiazhuid)
        {
            DAL.WanfaDAL wfdal = new DAL.WanfaDAL()
            {
                ConnStr = ConnStr
            };
            DAL.UserinfoDAL udal = new DAL.UserinfoDAL()
            {
                ConnStr = ConnStr
            };
            DAL.XiazhuinfoDAL xzdal = new DAL.XiazhuinfoDAL()
            {
                ConnStr = ConnStr
            };
            DAL.QihaoinfoDAL qhdal = new DAL.QihaoinfoDAL()
            {
                ConnStr = ConnStr
            };
            DAL.LiushuiDAL lsdal = new DAL.LiushuiDAL()
            {
                ConnStr = ConnStr
            };
            DAL.ShuxingDAL sxdal = new DAL.ShuxingDAL()
            {
                ConnStr = ConnStr
            };
            Model.Shuxing sx = sxdal.GetModelByCond($"sxname='特殊号返还'");
            if (sx == null)
            {
                throw new Exception("属性表中没有特殊号返还配置,请联系程序猿!");
            }
            double bfb_teshu = double.Parse(sx.sxvalue);

            Model.Xiazhuinfo xz = xzdal.GetModel(xiazhuid);
            if (xz == null)
            {
                throw new Exception("下注记录为空!");
            }
            if (xz.czid != 1)
            {
                throw new Exception("彩种ID不符合!");
            }
            if (!string.IsNullOrEmpty(xz.kjcode))
            {
                throw new Exception("该下注记录已开奖过!");
            }
            if (xz.iszj != 0)
            {
                throw new Exception($"该下注记录状态不对,iszj={xz.iszj}!");
            }
            Model.Userinfo u = udal.GetModel(xz.userid);
            if (u == null)
            {
                throw new Exception("下注用户为空");
            }
            Model.Qihaoinfo qh = qhdal.GetModelByCond($"qihao='{xz.qihao}'");
            if (qh == null)
            {
                throw new Exception("没有当前期信息");
            }
            if (string.IsNullOrEmpty(qh.kjcode))
            {
                throw new Exception("当前期未开奖");
            }

            Model.Wanfa wf = wfdal.GetModel(xz.wfid);


            string return_str = "没有任何结果,请联系程序猿!!!";

            #region 根据玩法名称进行开奖
            if (xz.buycode.Contains("专家版"))
            {
                bool b = new BLL.WanFa.ZhuanJiaBan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney  = u.balance;
                    double zjmoney      = xz.buymoney * 2;
                    double shouxufee    = xz.buymoney * 0.013; //手续费为中奖部署的金额的1.3%
                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == "13" || qh.kjcode == "14")
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * (bfb_teshu / 100);
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }
            else if (xz.buycode.Contains("大版"))
            {
                bool b = new BLL.WanFa.DaBan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney  = u.balance;
                    double zjmoney      = xz.buymoney * 2;
                    double shouxufee    = 0;
                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == "13")
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * (bfb_teshu / 100);
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }
            else if (xz.buycode.Contains("小版"))
            {
                bool b = new BLL.WanFa.XiaoBan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney  = u.balance;
                    double zjmoney      = xz.buymoney * 2;
                    double shouxufee    = 0;
                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == "14")
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * (bfb_teshu / 100);

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }
            else if (xz.buycode.Contains("单版"))
            {
                bool b = new BLL.WanFa.DanBan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * 2;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == "14")
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * (bfb_teshu / 100);
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }
            else if (xz.buycode.Contains("双版"))
            {
                bool b = new BLL.WanFa.ShuanBan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * 2;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == "13")
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * (bfb_teshu / 100);
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }
            else if (wf.groupname == "特码")
            {
                bool b = new BLL.WanFa.TeMa().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double peilv       = wfdal.GetModel(xz.wfid).peilv; //赔率
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }
            else if (xz.buycode == "小单包三边")
            {
                bool b = new BLL.WanFa.Bao3Bian_XiaoDan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了,总共返回客户400
                    double beforemoney = u.balance;
                    double zjmoney     = 400;

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == "13")
                {
                    //中特殊号,只返100给客户
                    double beforemoney = u.balance;
                    double zjmoney     = 100;

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }
            else if (xz.buycode == "小双包三边")
            {
                bool b = new BLL.WanFa.Bao3Bian_XiaoShuang().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了,总共返回客户400
                    double beforemoney = u.balance;
                    double zjmoney     = 400;


                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }
            else if (xz.buycode == "大双包三边")
            {
                bool b = new BLL.WanFa.Bao3Bian_DaShuang().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了,总共返回客户400
                    double beforemoney = u.balance;
                    double zjmoney     = 400;

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == "14")
                {
                    //中特殊号,返回100给客户
                    double beforemoney = u.balance;
                    double zjmoney     = 100;

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }
            else if (xz.buycode == "大单包三边")
            {
                bool b = new BLL.WanFa.Bao3Bian_DaDan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了,总共返回客户400
                    double beforemoney = u.balance;
                    double zjmoney     = 400;

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }
            }
            else if (xz.buycode == "极大")
            {
                bool b = new BLL.WanFa.JiDa().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    #region 中奖了
                    double peilv       = wf.peilv; //赔率
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);

                    #endregion
                }
                else
                {
                    #region 没中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                    #endregion
                }
            }
            else if (xz.buycode == "极小")
            {
                bool b = new BLL.WanFa.JiXiao().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    #region 中奖了
                    double peilv       = wf.peilv; //赔率
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * peilv;

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);

                    #endregion
                }
                else
                {
                    #region 没中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                    #endregion
                }
            }
            else if (xz.buycode == "豹子")
            {
                bool b = new BLL.WanFa.BaoZhi().IsZJ(qh.code1, qh.code2, qh.code3);
                if (b)
                {
                    #region 中奖了
                    double peilv       = wf.peilv; //赔率
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * peilv;

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);

                    #endregion
                }
                else
                {
                    #region 没中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                    #endregion
                }
            }
            else if (xz.buycode == "大")
            {
                #region 银河国际的

                bool b = new BLL.WanFa.Da().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;


                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == wf.tesu.ToString())
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = wf.tesu_peilv != -1 ? wf.tesu_peilv * xz.buymoney : wf.tesu_je;

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else if (xz.buycode == "小")
            {
                #region 银河国际的

                bool b = new BLL.WanFa.Xiao().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == wf.tesu.ToString())
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = wf.tesu_peilv != -1 ? wf.tesu_peilv * xz.buymoney : wf.tesu_je;

                    double shouxufee = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else if (xz.buycode == "单")
            {
                #region 银河国际的

                bool b = new BLL.WanFa.Dan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == wf.tesu.ToString())
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = wf.tesu_peilv != -1 ? wf.tesu_peilv * xz.buymoney : wf.tesu_je;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else if (xz.buycode == "双")
            {
                #region 银河国际的

                bool b = new BLL.WanFa.Shuan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == wf.tesu.ToString())
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = wf.tesu_peilv != -1 ? wf.tesu_peilv * xz.buymoney : wf.tesu_je;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else if (xz.buycode == "大单")
            {
                #region 银河国际的,15(含)以上的单数,特殊号14

                bool b = new BLL.WanFa.DaDan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else if (xz.buycode == "大双")
            {
                #region 银河国际的

                bool b = new BLL.WanFa.DaShuan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == wf.tesu.ToString())
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = wf.tesu_peilv != -1 ? wf.tesu_peilv * xz.buymoney : wf.tesu_je;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else if (xz.buycode == "小单")
            {
                #region 银河国际的,13(含)以下的单数,特殊号14

                bool b = new BLL.WanFa.XiaoDan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else if (qh.kjcode == wf.tesu.ToString())
                {
                    //特殊号码,客户得回下注金额的55%
                    double beforemoney = u.balance;
                    double zjmoney     = wf.tesu_peilv != -1 ? wf.tesu_peilv * xz.buymoney : wf.tesu_je;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 2, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else if (xz.buycode == "小双")
            {
                #region 银河国际的,14(含)以下的双数,特殊号13

                bool b = new BLL.WanFa.XiaoShuan().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else if (xz.buycode == "红波")
            {
                #region 银河国际的,红波:1.2.7.8.12.13.18.19.23.24.29.30.34.35.40.45.46

                bool b = new BLL.WanFa.HongBo().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else if (xz.buycode == "蓝波")
            {
                #region 银河国际的,蓝波:3.4.9.10.14.15.20.25.26.31.36.37.41.42.47.48

                bool b = new BLL.WanFa.LanBo().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else if (xz.buycode == "绿波")
            {
                #region 银河国际的,绿波:5.6.11.16.17.21.22.27.28.32.33.38.39.43.44.49

                bool b = new BLL.WanFa.LuBo().IsZJ(xz.buycode, qh.kjcode);
                if (b)
                {
                    //中奖了
                    double beforemoney = u.balance;
                    double zjmoney     = xz.buymoney * wf.peilv;
                    double shouxufee   = 0;

                    double real_zjmoney = zjmoney - shouxufee;


                    return_str = xzdal.ZhongJian(xz.id, 1, xz.buymoney, zjmoney, shouxufee, xz.buycode, qh.kjcode, beforemoney, xz.userid, xz.username, 0, xz.qihao);
                }
                else
                {
                    //末中奖
                    xz.iszj   = 0;
                    xz.kjcode = qh.kjcode;
                    xzdal.UpdateByCond($"iszj=0, kjcode='{qh.kjcode}'", $"id={xz.id}");
                    return_str = $"订单【{xz.id}】未中奖";
                }

                #endregion
            }
            else
            {
                throw new Exception("下注号不对,无此玩法");
            }
            #endregion

            return(return_str);
        }