public static void getSOCEstimate() { List <GetEstimate.ProductInfo> prodlst = new List <GetEstimate.ProductInfo>(); SOCRequest request = new SOCRequest(); GetEstimate.ProductInfo prodA = new GetEstimate.ProductInfo(); prodA.ProductIOSC = "A"; prodA.Rate = 10.0M; GetEstimate.ProductInfo prodB = new GetEstimate.ProductInfo(); prodB.ProductIOSC = "B"; prodB.Rate = 20.0M; GetEstimate.ProductInfo prodC = new GetEstimate.ProductInfo(); prodC.ProductIOSC = "C"; prodC.Rate = 30.0M; GetEstimate.ProductInfo prodD = new GetEstimate.ProductInfo(); prodD.ProductIOSC = "D"; prodD.Rate = 40.0M; prodlst.Add(prodA); prodlst.Add(prodB); prodlst.Add(prodC); prodlst.Add(prodD); request.Products = prodlst.ToArray(); //GetSOCEstimate SOCResponse response = getEstimate.GetSOCEstimate(request); if (response != null && response.SOCEstimate != null) { Console.WriteLine("\n"); Console.WriteLine("SOC Estimate :"); Console.WriteLine("SOC Monthly charges :" + response.SOCEstimate.Monthly); Console.WriteLine("SOC FirstBill charges :" + response.SOCEstimate.FirstBill); if (response.SOCEstimate.TaxResponse != null) { Console.WriteLine("SOC Monthly Taxes :" + response.SOCEstimate.TaxResponse.MonthlyTaxes); Console.WriteLine("SOC FirstBill Taxes :" + response.SOCEstimate.TaxResponse.FirstBillTaxes); } Console.WriteLine("\n"); } else { Console.WriteLine("\n"); Console.WriteLine("No SOCEstimate for the request"); Console.WriteLine("\n"); } }
public SOCResponse GetSOCEstimate(SOCRequest request) { SOCResponse response; if (request == null) { response = null; throw new ArgumentNullException("Response"); } else { response = new SOCResponse(); if (request != null && request.Products != null) { response.SOCEstimate = GetRecurringCharges(request.Products); response.Productlst = request.Products; } } return(response); }