public static LogObject ConvertToLogObject(MSLogObject mslo)
 {
     LogObject lo = new LogObject();
     lo.Id = mslo.id;
     lo.Who = mslo.who;
     lo.When = mslo.when;
     lo.What = mslo.what;
     lo.Verb = mslo.verb;
     return lo;
 }
        public static LogObject ConvertToLogObject(MSLogObject mslo)
        {
            LogObject lo = new LogObject();

            lo.Id   = mslo.id;
            lo.Who  = mslo.who;
            lo.When = mslo.when;
            lo.What = mslo.what;
            lo.Verb = mslo.verb;
            return(lo);
        }
        public async Task <bool> AddLogObjectAsync(LogObject log)
        {
            MSLogObject msno = LogObject.ConvertToMSLogObject(log);

            msno.spot_id = this.Id;
            try
            {
                await App.MobileService.GetTable <MSLogObject>().InsertAsync(msno);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
        public async Task <List <LogObject> > ListLogObjectsAsync()
        {
            List <LogObject> list = new List <LogObject>();
            MobileServiceCollection <MSLogObject, MSLogObject> mobileList = null;

            try
            {
                mobileList = await App.MobileService.GetTable <MSLogObject>()
                             .Where(item => item.spot_id == this.Id)
                             .ToCollectionAsync();
            }
            catch
            {
                return(null);
            }
            for (var i = 0; i < mobileList.Count; i++)
            {
                list.Add(LogObject.ConvertToLogObject(mobileList[i]));
            }
            return(list);
        }
 public static MSLogObject ConvertToMSLogObject(LogObject lo)
 {
     return(new MSLogObject(lo.Who, lo.When, lo.What, lo.Verb));
 }
 public async Task<bool> AddLogObjectAsync(LogObject log)
 {
     MSLogObject msno = LogObject.ConvertToMSLogObject(log);
     msno.spot_id = this.Id;
     try
     {
         await App.MobileService.GetTable<MSLogObject>().InsertAsync(msno);
         return true;
     }
     catch
     {
         return false;
     }
 }
 public static MSLogObject ConvertToMSLogObject(LogObject lo)
 {
     return new MSLogObject(lo.Who, lo.When, lo.What, lo.Verb);
 }