private string AddNo(Dictionary <string, string> queryvalues, string billNo)
        {
            SimulatorRecharge model = new GL.Data.Model.SimulatorRecharge();
            int     UserID          = queryvalues.ContainsKey("UserID") ? Convert.ToInt32(queryvalues["UserID"].ToString()) : 0;
            int     Type            = queryvalues.ContainsKey("Type") ? Convert.ToInt32(queryvalues["Type"].ToString()) : 1;
            decimal Money           = queryvalues.ContainsKey("Money") ? Convert.ToDecimal(queryvalues["Money"].ToString()) : 0;
            string  ProductID       = queryvalues.ContainsKey("ProductID") ? queryvalues["ProductID"].ToString() : "";
            double  Discounted      = queryvalues.ContainsKey("Discounted") ? Convert.ToDouble(queryvalues["Discounted"].ToString()) : 0;

            model.UserID     = UserID;
            model.Type       = Type;
            model.Money      = Money;
            model.Discounted = Discounted;

            string billNO = billNo;

            if (Type == 3)
            {
                int      userid   = UserID;
                Recharge recharge = RechargeBLL.GetFirstModelListByUserID(new Recharge {
                    UserID = userid
                });
                if (recharge != null) //首冲过
                {
                    return("2");      //重复首冲
                }
            }
            long transtimeL = Utils.GetTimeStampL();

            RechargeCheckBLL.Add(new RechargeCheck
            {
                Money      = (int)model.Money,
                ProductID  = ProductID,
                SerialNo   = billNO,
                UserID     = UserID,
                CreateTime = (ulong)transtimeL
            }
                                 );

            return(billNO);
        }
        public ActionResult SimulatorRechargeMoney(Dictionary <string, string> queryvalues)
        {
            string            ispostback = queryvalues.ContainsKey("ispostback") ? queryvalues["ispostback"].ToString() : "";
            SimulatorRecharge model      = new GL.Data.Model.SimulatorRecharge();


            int     UserID     = queryvalues.ContainsKey("UserID") ? Convert.ToInt32(queryvalues["UserID"].ToString()) : 0;
            int     Type       = queryvalues.ContainsKey("Type") ? Convert.ToInt32(queryvalues["Type"].ToString()) : 1;
            decimal Money      = queryvalues.ContainsKey("Money") ? Convert.ToDecimal(queryvalues["Money"].ToString()) : 0;
            double  Discounted = queryvalues.ContainsKey("Discounted") ? Convert.ToDouble(queryvalues["Discounted"].ToString()) : 0;

            model.UserID     = UserID;
            model.Type       = Type;
            model.Money      = Money;
            model.Discounted = Discounted;

            uint    gold     = 0;
            uint    dia      = 0;
            uint    rmb      = 0;
            bool    firstGif = false;
            isFirst iF       = isFirst.否;
            string  billNO   = Utils.GenerateOutTradeNo("TestPay");;

            if (Type == 3)
            {
                int      userid   = UserID;
                Recharge recharge = RechargeBLL.GetFirstModelListByUserID(new Recharge {
                    UserID = userid
                });
                if (recharge != null)     //首冲过
                {
                    return(Content("2")); //重复首冲
                }
            }
            long transtimeL = Utils.GetTimeStampL();

            RechargeCheckBLL.Add(new RechargeCheck
            {
                Money      = (int)model.Money,
                ProductID  = "Chip_8",
                SerialNo   = billNO,
                UserID     = UserID,
                CreateTime = (ulong)transtimeL
            }
                                 );



            //计算人名币
            if (Discounted > 0)
            {
                rmb = (uint)Convert.ToInt32((uint)Money * 100 * Discounted / 10);    //单位分
            }
            else
            {
                rmb = (uint)Convert.ToInt32((uint)Money * 100);    //单位分
            }


            switch (model.Type)
            {
            case 1:
                gold = (uint)Money * 10000;
                break;         //游戏币

            case 2:
                dia = (uint)Money * 10;
                break;         //五币

            default:
                gold     = (uint)Money * 10000;
                gold     = gold + 60000;
                firstGif = true;
                iF       = isFirst.是;
                break;         //首冲(默认加6万游戏币)
            }


            //normal ServiceNormalS = normal.CreateBuilder()
            //  .SetUserID((uint)UserID)
            //  .SetGold(gold)
            //  .SetDia(dia)
            //  .SetRmb(rmb)//单位 分
            //  .SetFirstGif(firstGif)
            //  .SetBillNo(billNO)
            //  .Build();

            //string tbindStr = Cmd.runClient(new Bind(BR_Cmd.BR_NORMAL, ServiceNormalS.ToByteArray()));
            return(Content("1"));
            //switch (tbindStr) {
            //    case "1":
            //        RechargeBLL.Add(
            //         new Recharge
            //         {
            //             BillNo = billNO,
            //             OpenID = billNO,
            //             UserID = model.UserID,
            //             Money = (long)rmb,
            //             CreateTime = DateTime.Now,
            //             Chip = gold,
            //             Diamond = dia,
            //             ChipType = (chipType)model.Type,
            //             IsFirst = iF,
            //             PF = raType.微信,
            //             PayItem = "Chip_8"


            //         });
            //        RechargeCheckBLL.Delete(new RechargeCheck { SerialNo = billNO });
            //        return Content("1");

            //    case "2":
            //        RechargeBLL.Add(
            //      new Recharge
            //      {
            //          BillNo = billNO,
            //          OpenID = billNO,
            //          UserID = model.UserID,
            //          Money = (long)rmb,
            //          CreateTime = DateTime.Now,
            //          Chip = gold,
            //          Diamond = dia,
            //          ChipType = (chipType)model.Type,
            //          IsFirst = iF,
            //          PF = raType.微信,
            //          PayItem = "Chip_8"


            //      });
            //        RechargeCheckBLL.Delete(new RechargeCheck { SerialNo = billNO });
            //        return Content("2");

            //    case "3":
            //        return Content("3");

            //    case "4":
            //        return Content("4");

            //    default:
            //        return Content(tbindStr);

            //}



            //充值
        }
        public ActionResult SimulatorRecharge(Dictionary <string, string> queryvalues)
        {
            SimulatorRecharge model = new GL.Data.Model.SimulatorRecharge();

            return(View(model));
        }