示例#1
0
        private async Task <bool> RemoveDlFromServer(DlBook localDlBook, UserCredential userCredential)
        {
            // in consideration of deleting dlbook in offline mode
            int deleteVersion = localDlBook.LastDownloadedVersion == 0 ? localDlBook.CurrentVersion : localDlBook.LastDownloadedVersion;
            // Used to validate the Status Code given by eReader.
            // Status Code : 1 => DL file Successfully downloaded by eReader.
            // Status Code : 2 => DL file deleted by the user.
            // Status Code : 3 => DL file deleted by eReader(backend).
            string             dlDeletedStatus    = "2";
            DlFileStatusUpdate dlFileStatusUpdate = new DlFileStatusUpdate
            {
                DeviceId   = GlobalAccess.DeviceId,
                Email      = userCredential.Email,
                DLId       = localDlBook.BookId,
                Ver        = deleteVersion.ToString(),
                StatusCode = dlDeletedStatus
            };
            var updateResult = await deliveryService.DlFileStatusUpdate(dlFileStatusUpdate);

            return(updateResult);
        }