Advertisement
Guest User

Untitled

a guest
Jul 9th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <cfif (session.EnablePreferredCustomerAutoAssign EQ 1) AND (session.EnablePreferredCustomerAutoAssignStore NEQ 0)>
  2.  
  3. <cfquery name="GetCustomerID" datasource="#session.TPCDS#" username="#session.QSAUsername#" password="#session.QSAPassword#">
  4. SELECT CUSTGroup
  5. FROM #session.TPPrefix##session.TPCDS#.dbo.PreferredCustomers
  6. WHERE CUSTClient = '#session.TPC.AccountID#'
  7. AND CUSTId = '{{cust_username}}'
  8. </cfquery>
  9. <!--- If Customer Belongs to a group ignore, if not assign. --->
  10. <cfif GetCustomerID.recordcount eq 0> <!-------- Start Record Count ----->
  11.  
  12. <cfquery name="AddCustomerID" datasource="#session.TPCDS#" username="#session.QSAUsername#" password="#session.QSAPassword#" timeout="20">
  13. Insert Into #session.TPPrefix##session.TPCDS#.dbo.PreferredCustomers (CUSTClient,CUSTGroup, CUSTID, CUSTRate)
  14. Values('#session.TPC.AccountID#','#session.EnablePreferredCustomerAutoAssignStore#','{{cust_username}}','99999')
  15. </cfquery>
  16.  
  17. </cfif>
  18.  
  19. </cfif>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement