Beispiel #1
0
        public async Task <bool> Process()
        {
            try {
                List <ActionEventUpdate> listCustomer = SQLiteDatabase.Instance.DataSyncGetActionEventList();

                UploadToServerRequestModel uploadToServerRequestModel = new UploadToServerRequestModel()
                {
                    UploadToServerXML = listCustomer,
                    UserLoginID       = GlobalVariables.UserLoginID
                };

                string result = await APIRequest.Instance.DataSyncUploadDataToServer(uploadToServerRequestModel);

                if (result != null)
                {
                    return(SQLiteDatabase.Instance.DeleteLocalData());
                }
                else
                {
                    return(false);
                }
            } catch {
                return(false);
            }
        }
Beispiel #2
0
        public async Task <string> DataSyncUploadDataToServer(UploadToServerRequestModel uploadToServerRequestModel)
        {
            string URL    = WebAPI.Instance.webLinkUploadDataToServerSync;
            var    result = await WebAPI.Instance.HttpRequestProcess("POST", URL, JsonConvert.SerializeObject(uploadToServerRequestModel));

            if (result != null)
            {
                return(result.Replace("\"", "").ToDecrypt());
            }
            return(null);
        }