public RetriveMediaResponse RetreiveMedia(string url, string linkid, int TypeId, int MediaContext, string saediFromid) { RetriveMediaResponse media = new RetriveMediaResponse(); try { media = RetreiveMediaMapping(url, linkid, TypeId, MediaContext, saediFromid); } catch (Exception ex) { onlineBookingLogBLL.InsertOnlineServiceLog("RetreiveMedia", ex.Message.ToString(), saediFromid, url, false); } return(media); }
private RetriveMediaResponse RetreiveMediaMapping(string url, string linkid, int TypeId, int MediaContext, string saediFromid) { RetriveMediaResponse mediaresult = new RetriveMediaResponse(); onlineClient.Url = url; TMediaResponse mediaResponse = onlineClient.RetrieveMedia(Convert.ToInt32(linkid), TypeId, MediaContext); //mapping media onlineBookingLogBLL.InsertOnlineServiceLog(mediaResponse, mediaResponse, saediFromid, url, mediaResponse.ErrorCode != 0); if (mediaResponse.ErrorCode == 0) { foreach (TMedia item in mediaResponse.MediaList) { ReceivedMedia receivedMedia = new ReceivedMedia(); receivedMedia.LinkID = item.LinkID; receivedMedia.TypeID = item.TypeID; receivedMedia.MediaExtension = item.MediaExtension; receivedMedia.MediaText = item.MediaText; receivedMedia.MediaTimeStamp = item.MediaTimeStamp; receivedMedia.MediaSubject = item.MediaSubject; receivedMedia.MediaContext = item.MediaContext; receivedMedia.MediaPrivateFg = item.MediaPrivateFg; receivedMedia.MSGUID = item.MSGUID; receivedMedia.FileName = item.FileName; mediaresult.receivedMedia.Add(receivedMedia); } } else { mediaresult.ErrorCode = mediaresult.ErrorCode; mediaresult.ErrorText = mediaresult.ErrorText; } return(mediaresult); }