Example #1
0
        private void BindData(BetList item)
        {
            if (item.Stauts == 3)
            {
                exitTd.Visible = true;
            }
            if (!isCatch)
            {
                LotteryCode = IoC.Resolve <ILotteryTypeService>().Where(c => c.LotteryCode == item.LotteryCode).FirstOrDefault().Id.ToString();
            }
            else
            {
                ISysCatchNumIssueService issueServices = IoC.Resolve <ISysCatchNumIssueService>();
                var xd = issueServices.GetLotteryId(item.BetCode);
                if (xd != null)
                {
                    LotteryCode = xd.Value.ToString();
                }
            }
            this.lbCode.Text     = item.Code;
            this.lbGame.Text     = item.LotteryName;
            this.lbbettCode.Text = item.BetCode;

            string st = "本人撤单";

            if (item.Stauts == 1)
            {
                st = "已中奖";
            }
            else if (item.Stauts == 2)
            {
                st = "未中奖";
            }
            else if (item.Stauts == 3)
            {
                st = "未开奖";
            }
            else if (item.Stauts == 5)
            {
                st = "系统撤单";
            }

            string modelStr = "元";

            switch (item.Model)
            {
            case 1:
                modelStr = "角";
                break;

            case 2:
                modelStr = "分";
                break;

            case 3:
                modelStr = "厘";
                break;
            }

            this.lbState.Text    = st;
            this.lbModel.Text    = item.Multiple + "倍 - " + modelStr + "";
            this.lbbetTime.Text  = item.OccDate.ToString("yyyy-MM-dd HH:mm:ss");
            this.lbIssue.Text    = item.IssueCode;
            this.lbOpenTime.Text = item.OpenResult;

            /***/
            lbPlayType.Text           = item.PlayTypeName + "" + item.PlayTypeRadioName;//玩法
            this.lbMonerty.Text       = item.WinMoney.ToString();
            this.lbSumMonery.Text     = item.TotalAmt.ToString();
            this.hidPostionName.Value = item.PostionName;
            this.lbSubscription.Text  = item.Subscription.ToString();
            //
            //可能中的奖金
            var fs = PlayTypeRadioServiceCatch.GetAll().Where(p => p.RadioCode == item.PalyRadioCode).FirstOrDefault();

            if (null == fs)
            {
                return;
            }
            txtContent.Text = item.BetContent;
            //"zhouke"
            var betUser = IoC.Resolve <ISysUserService>().Get(item.Code);

            if (null == betUser)
            {
                return;
            }
            List <WinsEntity> winSource = new List <WinsEntity>();

            if (!fs.HasMoreBonus)//普通奖金
            {
                //返点/舍弃返点
                string backText = string.Empty;
                double dm       = 0;
                if (betUser.PlayType == 0)//1800
                {
                    dm       = Math.Round((fs.MaxRebate - betUser.Rebate), 1);
                    backText = item.PrizeType == 1 ? " - " + dm + " % " : " - 0%";
                }
                else
                {
                    dm       = Math.Round((fs.MaxRebate1700 - betUser.Rebate), 1);
                    backText = item.PrizeType == 1 ? " - " + dm + " % " : " - 0%";
                }
                if (dm <= 0)
                {
                    dongtaiMonery.Visible = false;
                }
                lbBackNum.Text    = TotalWinMoney(item, 1, fs, betUser, false).ToString();
                lbBackNumlst.Text = backText;
                //如果为lhc,则隐藏返点
                if (item.LotteryCode == "hk6")
                {
                    dongtaiMonery.Visible = false;
                }

                winSource.Add(new WinsEntity()
                {
                    itemContent       = txtContent.Text,
                    meWinMoney        = item.LotteryCode == "hk6" ? (item.TotalAmt * (decimal)Ytg.ServerWeb.BootStrapper.SiteHelper.GetLiuHeMiult()).ToString() : TotalWinMoney(item, 1, fs, betUser).ToString(),
                    Multiple          = item.Multiple,
                    PlayTypeRadioName = string.IsNullOrEmpty(item.PostionName) ? item.PlayTypeRadioName : item.PostionName,
                    DetCount          = item.BetCount
                });
            }
            else
            {//拥有更多中奖方式的
                List <string> ct = new List <string>();
                if (item.BetContent.IndexOf("-") >= 0)
                {
                    var cts = item.BetContent.Split('-');
                    foreach (var c in cts)
                    {
                        if (string.IsNullOrEmpty(c))
                        {
                            continue;
                        }
                        ct.Add(SpecialConvert.ConvertTo(Convert.ToInt32("-" + c)));
                    }
                }
                var wins = PlayTypeRadiosBonusServiceCatch.GetAll().Where(c => c.RadioCode == fs.RadioCode).ToList();
                //是否为特殊玩法
                for (var i = 0; i < wins.Count; i++)
                {
                    var itemw = wins[i];
                    if (ct.Count > 0 && !ct.Contains(itemw.BonusTitle))
                    {
                        continue;
                    }
                    decimal[] models = { 1M, 0.1M, 0.01M, 0.001M };
                    winSource.Add(new WinsEntity()
                    {
                        itemContent       = txtContent.Text,
                        meWinMoney        = (Ytg.Comm.Global.DecimalConvert(betUser.PlayType == 0 ? itemw.BonusBasic : itemw.BonusBasic17) * models[item.Model] * item.Multiple).ToString(),
                        Multiple          = item.Multiple,
                        PlayTypeRadioName = HanZi[i] + "等奖_" + itemw.BonusTitle,
                        DetCount          = item.BetCount //投注注数
                    });
                }
                dongtaiMonery.Visible = false;
            }
            this.rptWins.DataSource = winSource;
            this.rptWins.DataBind();
        }
Example #2
0
        public void DrawMethod(MethodInfo method, CyberAttribute cyberAttrribute)
        {
            object locker = new object();

            if (method == null)
            {
                throw new ArgumentNullException(nameof(method));
            }
            if (cyberAttrribute == null)
            {
                throw new ArgumentNullException(nameof(method));
            }


            ButtonAttribute button = cyberAttrribute as ButtonAttribute;

            TheEditor.PrepareToRefuseGui(locker);
            if (button.CustomColor)
            {
                GUI.color = button.CurColor;
            }
            if ((Application.isPlaying == false && button.WhenCanPress == UnityEventCallState.RuntimeOnly) ||
                (button.WhenCanPress == UnityEventCallState.Off))
            {
                GUI.enabled = false;
            }


            string text = button.Text;

            if (string.IsNullOrEmpty(text))
            {
                text = method.Name;
            }
            object[]        finalArg      = null;
            ParameterInfo[] param         = method.GetParameters();
            GUILayoutOption elementHeight = GUILayout.Height(20);

            if (param.Length > 0)
            {
                finalArg = new object[param.Length];
                if (param.Length > 1)
                {
                    GUILayout.BeginVertical("groupBox");
                }
                else
                {
                    elementHeight = GUILayout.Height(button.Height);
                    if (button.InNextLine == false)
                    {
                        GUILayout.BeginHorizontal();
                    }
                }
            }

            for (int x = 0; x < param.Length; x++)
            {
                GUILayout.BeginHorizontal();
                string curretnArgCode = $"B_Arg1{x}";
                if (param.Length > 1)
                {
                    EditorGUILayout.PrefixLabel(new string( new char[] { char.ToUpper(param[x].Name[0]) }.Concat(param[x].Name.Skip(1)).ToArray()));
                }

                object val = CyberEdit.Current.GetGlobalValue(method, curretnArgCode);
                (string str, UnityEngine.Object refer) = TheEditor.GeneralField(val?.ToString() ?? "NULL", val as UnityEngine.Object, param[x].ParameterType,
                                                                                elementHeight);
                if (str is null)
                {
                    str = String.Empty;
                }
                val = SpecialConvert.Convert(param[x].ParameterType, refer, str);
                CyberEdit.Current.SetGlobalValue(method, curretnArgCode, val);
                finalArg[x] = val;
                GUILayout.EndHorizontal();
            }


            object result = null;
            List <GUILayoutOption> options = new List <GUILayoutOption>
            {
                GUILayout.Height(button.Height)
            };

            switch (button.CalcMode)
            {
            case CalcMode.UseContextSettings when CyberEdit.Current.CurrentInspectedMember is FieldInfo:
            case CalcMode.Calc:
                options.Add(GUILayout.Width(new GUIStyle("button").CalcSize(new GUIContent(text)).x));
                break;
            }
            if (GUILayout.Button(text, options.ToArray()))
            {
                if (method.IsStatic == false)
                {
                    result = method.Invoke(CyberEdit.Current.Target, finalArg);
                }
                else
                {
                    result = method.Invoke(null, finalArg);
                }
            }
            if (result is null == false)
            {
                Debug.Log($"{text}: {result}", CyberEdit.Current.Target);
            }
            if (param.Length > 0)
            {
                if (param.Length > 1)
                {
                    GUILayout.EndVertical();
                }
                else if (button.InNextLine == false)
                {
                    GUILayout.EndHorizontal();
                }
            }

            TheEditor.RefuseGui(locker);
        }