Exemplo n.º 1
0
 public static void AddInsectData(string name, string json)
 {
     using (var con = GetDbConnection())
     {
         var animal = new AnimalsInsect {
             Name = name, Data = json
         };
         con.InsertOrReplace(animal);
     }
 }
Exemplo n.º 2
0
        private static NormalAnimal SelectHemisphereAndConstructInsect(Hemisphere hemisphere, AnimalsInsect obj, bool owned, bool museumHave)
        {
            string time;

            if (obj.Time.Contains("全天"))
            {
                time = "全天";
            }
            else
            {
                time = obj.Time;
            }
            if (hemisphere == Hemisphere.North)
            {
                var normal = new NormalAnimal {
                    Name = obj.Name, Icon = obj.Image, Number = obj.Number, English = obj.English, Japanese = obj.Japanese, Price = Convert.ToInt32(obj.Price), Position = obj.Position, ShapeOrWeather = obj.Weather, Time = time, AppearMonth = MonthStringToList(obj.North), Owned = owned, MuseumHave = museumHave
                };
                return(normal);
            }
            else
            {
                var normal = new NormalAnimal {
                    Name = obj.Name, Icon = obj.Image, Number = obj.Number, English = obj.English, Japanese = obj.Japanese, Price = Convert.ToInt32(obj.Price), Position = obj.Position, ShapeOrWeather = obj.Weather, Time = time, AppearMonth = MonthStringToList(obj.South), Owned = owned, MuseumHave = museumHave
                };
                return(normal);
            }
        }