示例#1
0
		public static int InsertOrUpdateQA(QA qa){
			var lookup = MobileService.GetTable<QA> ().LookupAsync (qa.id);
			if (lookup == null || qa.id == null) {
				QATable.InsertAsync (qa);
			} else {
				QATable.UpdateAsync (qa);
			}
			MobileService.SyncContext.PushAsync();
			return 1;
		}
示例#2
0
        public static int InsertOrUpdateQA(QA qa)
        {
            var lookup = MobileService.GetTable <QA> ().LookupAsync(qa.id);

            if (lookup == null || qa.id == null)
            {
                QATable.InsertAsync(qa);
            }
            else
            {
                QATable.UpdateAsync(qa);
            }
            MobileService.SyncContext.PushAsync();
            return(1);
        }