public RateEstimateResponseVO CallwsGenRateEstimate([System.Xml.Serialization.XmlElementAttribute(Namespace = "http://tempuri.org/wsGenRateEstimate/")] RateEstimateRequestVO RateEstimateRequestVO) { object[] results = this.Invoke("CallwsGenRateEstimate", new object[] { RateEstimateRequestVO }); return((RateEstimateResponseVO)(results[0])); }
/// <remarks/> public void CallwsGenRateEstimateAsync(RateEstimateRequestVO RateEstimateRequestVO, object userState) { if ((this.CallwsGenRateEstimateOperationCompleted == null)) { this.CallwsGenRateEstimateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCallwsGenRateEstimateOperationCompleted); } this.InvokeAsync("CallwsGenRateEstimate", new object[] { RateEstimateRequestVO }, this.CallwsGenRateEstimateOperationCompleted, userState); }
public static void getAAACooperRate(ref double totalCharges, ref byte transitDays, ref QuoteData quoteData, ref LTLPiece[] m_lPiece, ref HelperFuncs.AccessorialsObj AccessorialsObj) { #region Bill date string day = DateTime.Today.Day.ToString(); string month = DateTime.Today.Month.ToString(); string year = DateTime.Today.Year.ToString().Substring(2); if (day.Length.Equals(1)) { day = '0' + day; } if (month.Length.Equals(1)) { month = '0' + month; } #endregion // Define the web service object gcmAPI.AAACooperRateService.wsGenRateEstimate ws = new gcmAPI.AAACooperRateService.wsGenRateEstimate(); #region Accessorials // For Additional Services var acclinelist = new List <gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine>(); #region Liftgate if (AccessorialsObj.LGPU) { var accline = new gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine() { AccCode = "LGP" }; acclinelist.Add(accline); } if (AccessorialsObj.LGDEL) { var accline = new gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine() { AccCode = "LGD" }; acclinelist.Add(accline); } #endregion #region Appointment if (AccessorialsObj.APTPU || AccessorialsObj.APTDEL) { var accline = new gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine() { AccCode = "NCM" }; acclinelist.Add(accline); } #endregion #region Inside Delivery if (AccessorialsObj.INSDEL) { var accline = new gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine() { AccCode = "ISD" }; acclinelist.Add(accline); } #endregion #region Residential if (AccessorialsObj.RESPU) { var accline = new gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine() { AccCode = "RSP" }; acclinelist.Add(accline); } if (AccessorialsObj.RESDEL) { var accline = new gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine() { AccCode = "RSD" }; acclinelist.Add(accline); } #endregion #region Construction if (AccessorialsObj.CONPU) { var accline = new gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine() { AccCode = "CSP" }; acclinelist.Add(accline); } if (AccessorialsObj.CONDEL) { var accline = new gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine() { AccCode = "CSD" }; acclinelist.Add(accline); } #endregion #region Not used /*if (AccessorialsObj.TRADEPU) * { * var accline = new gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine() * { * AccCode = "LGD" * }; * acclinelist.Add(accline); * } * if (AccessorialsObj.TRADEDEL) * { * var accline = new gcmAPI.AAACooperRateService.RateEstimateRequestVOAccLine() * { * AccCode = "LGD" * }; * acclinelist.Add(accline); * }*/ #endregion #endregion #region Items var lineitemslist = new List <gcmAPI.AAACooperRateService.RateEstimateRequestVORateEstimateRequestLine>(); string hazMatStr = ""; for (byte i = 0; i < m_lPiece.Length; i++) { #region Hazmat if (m_lPiece[i].HazMat.Equals(true)) { hazMatStr = "X"; } else { hazMatStr = ""; } #endregion var lineitems = new gcmAPI.AAACooperRateService.RateEstimateRequestVORateEstimateRequestLine() { Class = m_lPiece[i].FreightClass, Weight = Convert.ToInt16(m_lPiece[i].Weight).ToString(), //HandlingUnitType = "Drums", HandlingUnitType = "Pallets", HandlingUnits = Convert.ToInt16(m_lPiece[i].Quantity).ToString(), Length = Convert.ToInt16(m_lPiece[i].Length).ToString(), Width = Convert.ToInt16(m_lPiece[i].Width).ToString(), Height = Convert.ToInt16(m_lPiece[i].Height).ToString(), Hazmat = hazMatStr }; lineitemslist.Add(lineitems); } #endregion #region Set request info var request = new gcmAPI.AAACooperRateService.RateEstimateRequestVO { Token = AppCodeConstants.aaa_cooper_token, CustomerNumber = AppCodeConstants.aaa_cooper_customer_number, OriginCity = quoteData.origCity, OriginState = quoteData.origState, OriginZip = quoteData.origZip, OriginCountryCode = "USA", DestinationCity = quoteData.destCity, DestinationState = quoteData.destState, DestinationZip = quoteData.destZip, DestinCountryCode = "USA", WhoAmI = "T", BillDate = string.Concat(month, day, year), //BillDate = "050415", PrePaidCollect = "P", AccLine = acclinelist.ToArray(), RateEstimateRequestLine = lineitemslist.ToArray() }; #endregion // CallwsGenRateEstimate var responseMatches = ws.CallwsGenRateEstimate(request); if (!double.TryParse(responseMatches.TotalCharges, out totalCharges) || totalCharges.Equals(0)) { // No rate found throw new Exception(responseMatches.ErrorMessage); } byte.TryParse(responseMatches.TotalTransit, out transitDays); //HelperFuncs.writeToSiteErrors("aaa", responseMatches.TotalTransit); }
/// <remarks/> public void CallwsGenRateEstimateAsync(RateEstimateRequestVO RateEstimateRequestVO) { this.CallwsGenRateEstimateAsync(RateEstimateRequestVO, null); }