Ejemplo n.º 1
0
        public CustomerVehicleChangeResponse CustomerVehicleChange(CustomerVehicleChangeRequest request)
        {
            CustomerVehicleChangeResponse response = new CustomerVehicleChangeResponse();

            try
            {
                //Request body-header object validation
                response.Errors = GetErrorDataListFromRequestTransactionHeader(request.TransactionHeader);
                if (response.Errors != null)
                {
                    response.TransactionHeader = new Data.v2.Common.Common.TransactionHeader();
                    return response;
                }
                response.Errors = GetErrorDataListFromRequest(request.CustomerVehicleChange);
                if (response.Errors != null)
                {
                    response.TransactionHeader = request.TransactionHeader;
                    return response;
                }

                using (CustomerVehicle_Biz biz = new CustomerVehicle_Biz())
                {
                    response = biz.CustomerVehicleChange(request);
                }
            }
            catch (Exception ex)
            {
                response.Errors = GetErrorDataListFromException(ex);
                WA.Standard.IF.Logger.Log.Log.RootLogger.ErrorFormat("CustomerVehicleChangeResponse Error {0}: ", ex);
            }

            return response;
        }
Ejemplo n.º 2
0
        public CustomerVehicleChangeResponse CustomerVehicleChange(CustomerVehicleChangeRequest request)
        {
            CustomerVehicleChangeResponse response = new CustomerVehicleChangeResponse();

            try
            {
                WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "WA CustomerVehicleChangeRequest XML", request);

                //Request body-header object validation
                response.Errors = GetErrorDataListFromRequestTransactionHeader(request.TransactionHeader);
                if (response.Errors != null)
                {
                    response.TransactionHeader = new Data.v2.Common.Common.TransactionHeader();
                }
                response.Errors = GetErrorDataListFromRequest(request.CustomerVehicleChange);
                if (response.Errors != null)
                {
                    response.TransactionHeader = request.TransactionHeader;
                }

                if (response.Errors == null)
                {
                    using (CustomerVehicle_Biz biz = new CustomerVehicle_Biz())
                    {
                        response = biz.CustomerVehicleChange(request);
                    }

                    WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "WA CustomerVehicleChangeResponse XML", response);
                }
            }
            catch (Exception ex)
            {
                response.Errors = GetErrorDataListFromException(ex);
                WA.Standard.IF.Logger.Log.Log.SaveErrorLog(null, "CustomerVehicleChange", request, ex.Message, ex);
            }

            return response;
        }