예제 #1
0
        public static ProfileObject ConvertToProfileObject(MSProfileObject mspo)
        {
            ProfileObject po = new ProfileObject();

            po.Id          = mspo.id;
            po.Name        = mspo.name;
            po.PhoneNumber = mspo.phone_number;
            po.Email       = mspo.email;
            return(po);
        }
예제 #2
0
        public async Task <bool> PutProfileObjectAsync(ProfileObject po)
        {
            try
            {
                MSProfileObject mspo = po.ToMSObject();
                mspo.spot_id = this.Id;
                await App.MobileService.GetTable <MSProfileObject>().InsertAsync(mspo);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
예제 #3
0
        public async Task <List <ProfileObject> > ListProfileObjectsAsync()
        {
            List <ProfileObject> list = new List <ProfileObject>();
            MobileServiceCollection <MSProfileObject, MSProfileObject> msprofileList = null;

            try
            {
                msprofileList = await App.MobileService.GetTable <MSProfileObject>()
                                .Where(item => item.spot_id == this.Id)
                                .ToCollectionAsync();
            }
            catch
            {
                return(null);
            }
            for (var i = 0; i < msprofileList.Count; i++)
            {
                list.Add(ProfileObject.ConvertToProfileObject(msprofileList[i]));
            }
            return(list);
        }
예제 #4
0
 public async Task<bool> PutProfileObjectAsync(ProfileObject po)
 {
     try
     {
         MSProfileObject mspo = po.ToMSObject();
         mspo.spot_id = this.Id;
         await App.MobileService.GetTable<MSProfileObject>().InsertAsync(mspo);
         return true;
     }
     catch
     {
         return false;
     }
 }
예제 #5
0
 public static ProfileObject ConvertToProfileObject(MSProfileObject mspo)
 {
     ProfileObject po = new ProfileObject();
     po.Id = mspo.id;
     po.Name = mspo.name;
     po.PhoneNumber = mspo.phone_number;
     po.Email = mspo.email;
     return po;
 }