/// <summary> /// Get traveller payment means for a traveller on a service /// parameter retval will be updated /// </summary> /// <param name="retval">Traveller payment means</param> public static void GetTravellerPaymentMeans(TravelerPaymentMeansResponse retval) { Navision nws = null; try { // Define a new navision ws connection nws = new Navision(); // instanciate a new webservice Nav_PaymentMeans pm = new Nav_PaymentMeans(); // call the method and return the payment means nws.GetTravellerPaymentMeans(NavWsLogin, NavWsPassword, retval.GetArgPos(), retval.GetArgComcode(), retval.GetArgPercode(), retval.GetArgServicesList(), retval.GetArgCostCenter(), ref pm); // Set result retval.SetValue(pm); } finally { // Let's dispose now if (nws != null) { nws.Dispose(); } } }
/// <summary> /// Test function for Navision webservice /// Ask payment means for customer 2 /// </summary> public static void Test() { Navision nws = null; try { // Define a new navision ws connection nws = new Navision(); // instanciate a new webservice Nav_PaymentMeans pm = new Nav_PaymentMeans(); // call the method and return the payment means nws.GetTravellerPaymentMeans(NavWsLogin, NavWsPassword, Const.PosFrance, "2", string.Empty, Const.ServiceAIR, string.Empty, ref pm); } finally { // Let's dispose now if (nws != null) { nws.Dispose(); } } }
/// <summary> /// Set result from Navision ws /// </summary> /// <param name="value">NavPaymentMeans</param> public void SetValue(Nav_PaymentMeans value) { this.travelerPaymentMeanResponse.SetValue(value); // Let's check if we have an exception code string exceptionCode = value.NavException == null ? null : value.NavException[0].NavExceptionCode[0]; if (!String.IsNullOrEmpty(exceptionCode)) { // We have an exception here this.ExceptionCount = 1; // set exception code and message this.ExceptionCode = exceptionCode; this.ExceptionMessage = value.NavException[0].NavExceptionDesc[0]; this.ExceptionSeverity = CCEExceptionMap.EXCEPTION_SEVERITY_ERROR; this.ExceptionType = CCEExceptionMap.EXCEPTION_TYPE_FONCTIONAL; } }