Exemple #1
0
        public void SyncReference(List <Investment.Portable.TblReference> result)
        {
            for (int i = 0; i < result.Count; i++)
            {
                try{
                    String       id   = result[i].ID.ToUpper();
                    TblReference item = (from s in Table <TblReference>() where s.FieldID.ToUpper().Equals(id) select s).FirstOrDefault();
                    if (item == null)
                    {
                        AddReference(result[i].ID, result[i].Name, result[i].Value, result[i].DateCreated, result[i].DateEdited);
                    }
                    else
                    {
                        item.FieldID     = result[i].ID;
                        item.Name        = result[i].Name;
                        item.Value       = result[i].Value;
                        item.DateCreated = result[i].DateCreated;
                        item.DateEdited  = result[i].DateEdited;

                        Update(item);
                    }
                }
                catch (Exception e) {
                }
            }
        }
Exemple #2
0
        public void AddReference(String fieldID, String name, String value, String dateCreated, String dateEdited)
        {
            TblReference newItem = new TblReference {
                FieldID = fieldID, Name = name, Value = value, DateCreated = dateCreated, DateEdited = dateEdited
            };

            Insert(newItem);
        }
Exemple #3
0
        public String GetReferenceValue(String name)
        {
            String result = "";

            try{
                TblReference item = (from s in Table <TblReference>() where s.Name.Equals(name) select s).FirstOrDefault();
                result = item.Value;
            }
            catch (Exception ex) {
            }

            return(result);
        }