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

            try
            {
                List <Animal_Info_S> Detail_Ss = Animal_Info_S.GetBase(record.Buy_Content, Animal_Info_List, record.BuyPayReturn);
                var cont7 = PrizeContent.Length >= 7 ? Split_Hepler.str_to_stringss(PrizeContent)[6] : "0";
                //特奖
                int conti7 = Convert.ToInt32(cont7);
                foreach (var item in Detail_Ss)
                {
                    if (item.GlobeCodeList.Contains(conti7))
                    {
                        getdecimal += (decimal)(item.PayReturn * record.UnitPrice);
                        AwardList.Add(item.Name);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(getdecimal);
        }
示例#2
0
        /// <summary>
        /// 设置生肖
        /// </summary>
        public void Set_Animal(Globe_Clue item, List <Animal_Info> Animal_Info_List, List <Globe> GlobeList)
        {
            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]);
                    Animal_Info animal_Info = Animal_Info_List.FirstOrDefault(g => g.Code == clue);
                    if (animal_Info != null)
                    {
                        float         pay          = float.Parse(globe_pays[i]);
                        Animal_Info_S Animal_InfoS = Animal_Info_S.GetBase(animal_Info, pay);

                        List <Globe_S> templist = new List <Globe_S>();
                        foreach (var code in Animal_InfoS.GlobeCodeList)
                        {
                            Globe globle = GlobeList.FirstOrDefault(c => c.Code == code);
                            if (globle != null)
                            {
                                Globe_S globle_s = Globe_S.GetBase(globle);
                                templist.Add(globle_s);
                            }
                        }
                        Animal_InfoS.GlobeList = templist.ToArray();
                        this.Animal_List.Add(Animal_InfoS);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
示例#3
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);
        }
示例#4
0
        public static decimal GetAward(string PrizeContent, Operation_Record record, List <Animal_Info> Animal_Info_List, ref List <Araw_Return_S> Araw_Return_Ss, ref List <string> NoAwardList, 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);
                var cont7 = PrizeContent.Length >= 7 ? Split_Hepler.str_to_stringss(PrizeContent)[6] : "0";
                //特奖
                int conti7 = Convert.ToInt32(cont7);

                List <int> contents = Split_Hepler.str_to_ints(record.Buy_Content).ToList();
                foreach (var content in contents)
                {
                    Animal_Info_S detail_S = Animal_Info_Ss.FirstOrDefault(i => i.Code == content);
                    if (detail_S != null && detail_S.GlobeCodeList.Contains(conti7))
                    {
                        //if (conti7 == 49)
                        //{
                        //    //使用和局
                        //    Araw_Return_Ss.Add(new Araw_Return_S() { Name = detail_S.Name, Araw_Money = (decimal)record.UnitPrice });
                        //}
                        //else
                        //{
                        getdecimal += (decimal)(detail_S.PayReturn * record.UnitPrice);
                        AwardList.Add(detail_S.Name);
                        //}
                    }
                    else
                    {
                        NoAwardList.Add(detail_S.Name);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(getdecimal);
        }
示例#5
0
        public static decimal GetAward(Globe_Clue Globe_Clue, string PrizeContent, Operation_Record record, List <Animal_Info> Animal_Info_List, ref List <string> AwardList)
        {
            decimal getdecimal = 0;
            string  animals    = string.Empty;

            try
            {
                List <Animal_Info_S> Animal_Info_Ss = Animal_Info_S.GetBase(record.Buy_Content, Animal_Info_List, record.BuyPayReturn);

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

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