Beispiel #1
0
        public static decimal GetAward(string PrizeContent, Operation_Record record, List <Animal_Info> Animal_Info_List, List <Detail> Detail_List, ref List <string> AwardList)
        {
            decimal getdecimal = 0;

            try
            {
                List <Animal_Info_S> Animal_Info_Ss = Animal_Info_S.GetBase(record.Buy_Content, Animal_Info_List, record.BuyPayReturn);
                List <Detail_S>      Detail_Ss      = Detail_S.GetBase(record.Buy_Content2, Detail_List, record.BuyPayReturn2);


                var contList7 = Split_Hepler.str_to_ints(PrizeContent).ToList();

                foreach (var content in Animal_Info_Ss)
                {
                    foreach (var item in contList7)
                    {
                        //Animal_Info_S animal_Info_S = Animal_Info_Ss.FirstOrDefault(i => i.Code == content);
                        if (content.GlobeCodeList.Contains(item))
                        {
                            getdecimal += (decimal)(content.PayReturn * record.UnitPrice);
                            AwardList.Add(content.Name);
                            break;
                        }
                    }
                }


                foreach (var content in Detail_Ss)
                {
                    foreach (var item in contList7)
                    {
                        //Detail_S detail_S = Detail_Ss.FirstOrDefault(i => i.Code == content);
                        if (content.GlobeCodeList.Contains(item))
                        {
                            getdecimal += (decimal)(content.PayReturn * record.UnitPrice);
                            AwardList.Add(content.Name);
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(getdecimal);
        }
Beispiel #2
0
 /// <summary>
 /// 设置尾数
 /// </summary>
 public void Set_DetailF(Globe_Clue item, List <Detail> Detail_List)
 {
     try
     {
         string[] globe_clues = item.Clue.Split(new char[] { ',' });
         string[] globe_pays  = item.Pay.Split(new char[] { ',' });
         for (int i = 0; i < globe_clues.Length; i++)
         {
             int    clue   = Convert.ToInt32(globe_clues[i]);
             Detail Detail = Detail_List.FirstOrDefault(g => g.Code == clue);
             if (Detail != null)
             {
                 float    pay      = float.Parse(globe_pays[i]);
                 Detail_S Detail_S = Detail_S.GetBase(Detail, pay);
                 this.Detail_List.Add(Detail_S);
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.Error(ex);
     }
 }
        public static void SetContent(Globe_Clue clue, Operation_Record_S item)
        {
            try
            {
                GlobeClueType GlobeClueType = (GlobeClueType)clue.First_Type;
                switch (GlobeClueType)
                {
                case GlobeClueType.Special:
                    item.BuyDisplay     = Globe_S.GetBase_Str(item.Buy_Content, Constant.Globe_List);
                    item.FirstGlobeList = Globe_S.GetBase(item.Buy_Content, Constant.Globe_List);
                    item.FirstIsGloble  = true;
                    item.BuyDisplay2    = Size_S.GetBase_Str(item.Buy_Content2, Constant.Size_Special_List);
                    break;

                case GlobeClueType.Normal:
                    item.BuyDisplay     = Globe_S.GetBase_Str(item.Buy_Content, Constant.Globe_List);
                    item.FirstGlobeList = Globe_S.GetBase(item.Buy_Content, Constant.Globe_List);
                    item.FirstIsGloble  = true;
                    break;

                case GlobeClueType.SpecialNormal:
                    item.BuyDisplay     = Globe_S.GetBase_Str(item.Buy_Content, Constant.Globe_List);
                    item.FirstGlobeList = Globe_S.GetBase(item.Buy_Content, Constant.Globe_List);
                    item.FirstIsGloble  = true;
                    item.BuyDisplay2    = Size_NormalS.GetBase_Str(item.Buy_Content2, Constant.Size_SpecialNormal_List);
                    break;

                case GlobeClueType.NormalSix:
                    item.BuyDisplay = Size_Six_S.GetBase_Str(item.Buy_Content, Constant.Size_Six_List);
                    break;

                case GlobeClueType.Line:
                    item.BuyDisplay     = Globe_S.GetBase_Str(item.Buy_Content, Constant.Globe_List);
                    item.FirstGlobeList = Globe_S.GetBase(item.Buy_Content, Constant.Globe_List);
                    item.FirstIsGloble  = true;
                    break;

                case GlobeClueType.Wave:
                    item.BuyDisplay = Wave_S.GetBase_Str(item.Buy_Content, Constant.Wave_List);
                    break;

                case GlobeClueType.Detail:
                    item.BuyDisplay  = Animal_Info_S.GetBase_Str(item.Buy_Content, Constant.Animal_Info_List);
                    item.BuyDisplay2 = Detail_S.GetBase_Str(item.Buy_Content2, Constant.Detail_List);
                    break;

                case GlobeClueType.SpecialAnimal:
                    item.BuyDisplay = Animal_Info_S.GetBase_Str(item.Buy_Content, Constant.Animal_Info_List);
                    break;

                case GlobeClueType.CombineAnimal:
                    item.BuyDisplay = Animal_Info_S.GetBase_Str(item.Buy_Content, Constant.Animal_Info_List);
                    break;

                case GlobeClueType.LineAnimal:
                    item.BuyDisplay = Animal_Info_S.GetBase_Str(item.Buy_Content, Constant.Animal_Info_List);
                    break;

                case GlobeClueType.LineDetail:
                    item.BuyDisplay = Detail_S.GetBase_Str(item.Buy_Content, Constant.Detail_List);
                    break;

                case GlobeClueType.NotAll:
                    item.BuyDisplay     = Globe_S.GetBase_Str(item.Buy_Content, Constant.Globe_List);
                    item.FirstGlobeList = Globe_S.GetBase(item.Buy_Content, Constant.Globe_List);
                    item.FirstIsGloble  = true;
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
Beispiel #4
0
        public static decimal GetAward(Globe_Clue Globe_Clue, string PrizeContent, Operation_Record record, List <Detail> Detail_List, ref List <string> AwardList)
        {
            decimal getdecimal = 0;
            string  animals    = string.Empty;

            try
            {
                List <Detail_S> Detail_Ss = Detail_S.GetBase(record.Buy_Content, Detail_List, record.BuyPayReturn);

                List <int> contListall = Split_Hepler.str_to_ints(PrizeContent).ToList();

                int            count    = 0;
                LineDetailType LineType = (LineDetailType)Globe_Clue.Second_Type;
                if (LineType == LineDetailType.二尾连中 || LineType == LineDetailType.尾连中 || LineType == LineDetailType.四尾连中)

                {
                    foreach (var animal in Detail_Ss)
                    {
                        foreach (var awardGlobe in contListall)
                        {
                            if (animal.GlobeCodeList.Contains(awardGlobe))
                            {
                                count++;
                                animals += animal.Name + ",";
                                break;
                            }
                        }
                    }
                    if (count >= Detail_Ss.Count)
                    {
                        getdecimal += (decimal)(record.MinPayReturn * record.UnitPrice);
                        AwardList.Add(animals);
                    }
                }
                else if (LineType == LineDetailType.二尾连不中 || LineType == LineDetailType.尾连不中 || LineType == LineDetailType.四尾连不中)
                {
                    foreach (var animal in Detail_Ss)
                    {
                        bool NoAdd = false;
                        foreach (var awardGlobe in contListall)
                        {
                            if (!animal.GlobeCodeList.Contains(awardGlobe))
                            {
                                NoAdd = true;
                                break;
                            }
                        }
                        if (!NoAdd)
                        {
                            count++;
                        }
                    }
                    if (count >= Detail_Ss.Count)
                    {
                        getdecimal += (decimal)(record.MinPayReturn * record.UnitPrice);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(getdecimal);
        }