示例#1
0
        public static List <Globe_S> GetBase(string globes, List <Globe> Globe_List)
        {
            List <Globe_S> list = new List <Globe_S>();

            try
            {
                if (!string.IsNullOrEmpty(globes))
                {
                    string[] globeArray = globes.Split(new char[] { ',' });

                    for (int i = 0; i < globeArray.Length; i++)
                    {
                        int   clue  = Convert.ToInt32(globeArray[i]);
                        Globe globe = Globe_List.FirstOrDefault(g => g.Code == clue);
                        list.Add(Globe_S.GetBase(globe));
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }

            return(list);
        }
示例#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
        /// <summary>
        /// 设置半波
        /// </summary>
        public void Set_Wave(Globe_Clue item, List <Wave> Wave_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]);
                    Wave wave = Wave_List.FirstOrDefault(g => g.Code == clue);
                    if (wave != null)
                    {
                        float  pay    = float.Parse(globe_pays[i]);
                        Wave_S Wave_S = Wave_S.GetBase(wave, pay);

                        List <Globe_S> templist = new List <Globe_S>();
                        foreach (var code in Wave_S.GlobeCodeList)
                        {
                            Globe globle = GlobeList.FirstOrDefault(c => c.Code == code);
                            if (globle != null)
                            {
                                Globe_S globle_s = Globe_S.GetBase(globle);
                                templist.Add(globle_s);
                            }
                        }
                        Wave_S.GlobeList = templist.ToArray();
                        this.Wave_List.Add(Wave_S);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
示例#4
0
        public static Globe_S GetBase(Globe globe)
        {
            Globe_S Globe_S = new Globe_S()
            {
                Id       = globe.Id,
                Code     = globe.Code,
                Color    = globe.Color,
                IsEnable = globe.IsEnable,
                Name     = globe.Name,
            };

            return(Globe_S);
        }
示例#5
0
        public static Globe_S GetBase(Globe item, float pay)
        {
            Globe_S Globe_S = new Globe_S()
            {
                Id        = item.Id,
                Code      = item.Code,
                Color     = item.Color,
                IsEnable  = item.IsEnable,
                Name      = item.Name,
                PayReturn = pay,
            };

            return(Globe_S);
        }
示例#6
0
 /// <summary>
 /// 设置球个例
 /// </summary>
 public void Set_Clobe(Globe_Clue item, List <Globe> Globe_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]);
             Globe globe = Globe_List.FirstOrDefault(g => g.Code == clue);
             if (globe != null)
             {
                 float   pay     = float.Parse(globe_pays[i]);
                 Globe_S Globe_S = Globe_S.GetBase(globe, pay);
                 this.Globe_S_List.Add(Globe_S);
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.Error(ex);
     }
 }