Dynamicweb.eCommerce.Orders Namespace > OrderLineFieldValue Class : GetCartInputFieldName Method |
'Declaration
Public Function GetCartInputFieldName( _ ByVal orderLineID As String _ ) As String
public void validateOrderLineFieldValues( Order order, int orderStep ) { List<ValidationField> validationFields = ValidationField.GetAllFields(orderStep); Dictionary<string, string> errorMsgs = null; Report errorReport = new Report(orderStep); foreach(OrderLine mainOrderLine in order.OrderLines ) { OrderLineCollection orderLinesWithBOM = new OrderLineCollection(); orderLinesWithBOM.Add(mainOrderLine); foreach( OrderLine bomOrderLine in mainOrderLine.BOMOrderLines ) orderLinesWithBOM.Add(bomOrderLine); foreach( OrderLine orderLine in orderLinesWithBOM ) { foreach( OrderLineFieldValue orderLineFieldValue in orderLine.OrderLineFieldValues ) { if( orderLineFieldValue.OrderLineFieldSystemName == validationfield.SystemName ) { String value = Base.Request(OrderLineFieldValue.GetCartInputFieldName(OrderLine.ID)); { if( value == null || !validation.Validates(value) ) { if( errorMsgs == null ) errorMsgs = settings.GetValidationErrorMsgs(); errorReport.Add(validationfield, errorMsgs(validation.ID)); orderLineFieldValue.ValidationErrorMessage = errorMsgs(validation.ID); } else { orderLineFieldValue.ValidationErrorMessage = ""; } break; // On a single orderline, no two orderlinefields are the same. } } } return errorReport; } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2