protected override void ValidateRules(BrokenRules Verify) { if (IsDeleted) { return; } Verify.IsNotNull(m_part, "INVALIDLINEITEM", "Invalid Part Number " + m_partNumber, "PartId"); Verify.IsNotNull(m_identType, "IdentTypeReq", "Ident Type is required.", "IdentType"); if (m_identType != null) { Verify.IsFalse(m_identType.Name == "Nonserialized" & m_serviceRoute != null, "serializedRouteReq", "Service routes are not valid for non-serialized product", "IdentType"); Verify.IsFalse(m_purchaseOrder.ReturnType == ReturnType.Service && m_identType.Name == "Serialized" && m_serviceRoute == null, "ServiceRouteRequired", "Service Route is required for part number: " + m_part.PartNumber, "ServiceRoute"); } }
protected override void ValidateRules(BrokenRules Verify) { Verify.IsNotNull(m_shopfloorline, "SflRequired", "Shopfloorline is required.", "Shopfloorline"); Verify.IsNotNull(m_recDomain, "RecDomainRequired", "Rec domain is required.", "RecDomain"); Verify.IsNotNull(m_organization, "OrgRequired", "Supplier is required.", "Organization"); Verify.IsTrue(m_returnType != ReturnType.NotDefined, "ReturnTypeRequired", "Return Type is required.", "ReturnType"); Verify.IsFalse( m_shopfloorline != null && m_shopfloorline.IsProgramRequired && string.IsNullOrEmpty(m_program), "ProgramRequired", "Program is required.", "Program"); if (this.Order.OrderType == OrderType.ReturnNReplace && !Order.IsTemplate) { Verify.IsTrue(LineItems.Count > 0, "RnRLineItemsReq", "Purchase order line items are required for a return n replace order.", "CartItems"); } foreach (PurchaseLineItem purchaseLineItem in LineItems) { if (!purchaseLineItem.IsDeleted) { Verify.IsTrue(purchaseLineItem.Error.Length == 0, Guid.NewGuid().ToString(), purchaseLineItem.Error, "PartId"); } } }
protected override void ValidateRules(BrokenRules Verify) { Verify.IsNotNull(m_organization, "SONoCustomer", "No customer selected.", "Organization"); Verify.IsFalse( HasDuplicateSOItems(), "SODupCartItems", "There are duplicate items in the cart.", "CartItems"); Verify.IsNotEmpty(SalesRep, "SONoSalesRep", "No sales rep selected.", "SalesRep"); Verify.IsNotNull(m_shopfloorline, "SflReq", "Sales Order shopfloorline is required.", "Shopfloorline"); Verify.IsNotEmpty(m_shipToAddress, "ShipToReq", "Ship To Address is required", "ShipToAddress"); if (this.Order.OrderType == OrderType.ReturnNReplace && !Order.IsTemplate) { Verify.IsTrue(CartItems.Count > 0, "RnRLineItemsReq", "Sales order line items are required for a return n replace order.", "CartItems"); } foreach (SalesLineItem salesLineItem in CartItems) { if (!salesLineItem.IsDeleted) { Verify.IsTrue(salesLineItem.Error.Length == 0, Guid.NewGuid().ToString(), salesLineItem.Error, "PartId"); } } }
protected override void ValidateRules(BrokenRules Verify) { Verify.IsNotNull(m_shopfloorline, "ShopfloorlineReq", "Shopfloorline Required.", "Shopfloorline"); Verify.IsNotNull(m_partModel, "PartModelReq", "Part Model is required.", "PartModel"); Verify.IsFalse(string.IsNullOrEmpty(m_description), "ConfigurationDescriptionReq", "Configuration Description is required", "ConfigurationDescription"); }
protected override void ValidateRules(BrokenRules Verify) { base.ValidateRules(Verify); Verify.IsFalse(Name == "", "ContactNameRequired", "Name"); }