/// <summary> /// Updates download session status in database. /// </summary> /// <param name="activityId">The activity identifier associated with the request.</param> /// <param name="downloadSession">The download session.</param> public void UpdateDownloadSessionStatus(Guid activityId, DM.DownloadSession downloadSession) { using (RetailRealTimeServiceContractChannel channel = this.clientFactory.CreateTransactionServiceClient()) using (var contextScope = new OperationContextScope(channel)) { this.SetActivityIdInHttpHeader(activityId); CP.DownloadSessionUpdateStatus session = ConvertDownloadSessionsUpdateStatus(downloadSession); CP.UpdateDownloadSessionStatus request = new CP.UpdateDownloadSessionStatus() { downloadSession = session }; channel.UpdateDownloadSessionStatus(request); channel.Close(); } }
/// <summary> /// Converts data contract download session to proxy DownloadSessionUpdateStatus . /// </summary> /// <param name="session">Data contract download session.</param> /// <returns>Proxy DownloadSessionUpdateStatus.</returns> private static CP.DownloadSessionUpdateStatus ConvertDownloadSessionsUpdateStatus(DM.DownloadSession session) { CP.DownloadSessionUpdateStatus returnSession = new CP.DownloadSessionUpdateStatus { DataStoreName = session.DataStoreName, DateDownloaded = session.DateDownloaded, Id = session.Id, RowsAffected = session.RowsAffected, Status = (CP.RetailCDXDownloadSessionStatus)Enum.Parse(typeof(CP.RetailCDXDownloadSessionStatus), session.Status.ToString(), true), Message = session.Message }; return(returnSession); }