// CONVERT WEB-MODEL BID TO SERVICE BID public proxyRef.Bid ConvertToServiceBid(WebBid webBid) { proxyRef.Bid proxyWebBid = null; if (webBid != null) { proxyWebBid = new proxyRef.Bid { Id = webBid.Id, AuctionId = webBid.AuctionId, BidAmount = webBid.BidAmount, CustomerId = webBid.CustomerId }; } return(proxyWebBid); }
// CONVERT WEB MODEL BID TO SERVICE BID public WebBid ConvertFromServiceBid(proxyRef.Bid sBid) { WebBid foundClientBid = null; if (sBid != null) { foundClientBid = new WebBid { Id = sBid.Id, AuctionId = sBid.AuctionId, BidAmount = sBid.BidAmount, CustomerId = sBid.CustomerId }; } return(foundClientBid); }
public WebBid GetBidById(int bidId) { WebBid aWebBid = null; proxyRef.Bid aProxyBid = null; using (proxyRef.BidServiceClient bidProxy = new proxyRef.BidServiceClient()) { aProxyBid = bidProxy.GetBidById(bidId); } if (aProxyBid != null) { aWebBid = new TransformBid().ConvertFromServiceBid(aProxyBid); } else { aWebBid = new WebBid() { }; } return(aWebBid); }