Пример #1
0
        public void AddStatsType(String fieldID, String name, String icon)
        {
            TblStatsType newItem = new TblStatsType {
                FieldID = fieldID, Name = name, Icon = icon, Deleted = 0
            };

            Insert(newItem);
        }
Пример #2
0
        public void SyncStatTypes(List <Investment.Portable.TblStatsType> result)
        {
            for (int i = 0; i < result.Count; i++)
            {
                try{
                    String       id   = result[i].ID.ToUpper();
                    TblStatsType item = (from s in Table <TblStatsType>() where s.FieldID.ToUpper().Equals(id) select s).FirstOrDefault();
                    if (item == null)
                    {
                        AddStatsType(result[i].ID, result[i].Name, result[i].Icon);
                    }
                    else
                    {
                        item.FieldID = result[i].ID;
                        item.Name    = result[i].Name;
                        item.Icon    = result[i].Icon;

                        Update(item);
                    }
                }
                catch (Exception e) {
                }
            }
        }