Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert .net code to CF...help...

Status
Not open for further replies.

ktucci

Programmer
Apr 23, 2001
146
0
0
US
i am far ffrom an expert on coldfusion and need to implement some exisitng .net into CF...is this possible, if so could someone point me in the right direction...this below code is what i am trying duplicate in CF and below that is my attempt...

any help will be greatly appreciated...thanks keith

--------CODE TO CONVERT TO CF-------------------------

Dim importAccountMgt
Dim newAccountMap
Dim accountDataMap
Dim accountRS
Dim premisesDataMap
Dim premisesRS
Dim customerDataMap
Dim customerRS
Dim customerContactMethodRS
Dim customerAuthorizationRS
Dim companyRS
Dim AccountId

importAccountMgt = CreateObject("COMXImportMgt.COMXImportAccountMgt.1")
newAccountMap = importAccountMgt.BlankImportAccountFull()

accountDataMap = newAccountMap.At(500)
accountRS = accountDataMap.At(108)
accountRS.AddNew()
accountRS("opened_datetime") = Now()
accountRS("status_code") = "PROSPECT" 'status_code
accountRS("payment_type_code") = "DIR" 'payment_type_code
accountRS("bill_cycle") = 1 'bill_cycle
accountRS("primary_vendor_id") = 1 'primary_vendor_id
'''ORG
'accountRS("account_type_code") = "ORG"
'accountRS("containing_group_id") = 0
'''CO
accountRS("account_type_code") = "CO" 'account_type_code

premisesDataMap = newAccountMap.At(501)
premisesRS = premisesDataMap.At(200)
premisesRS.AddNew()
premisesRS("line_one") = "4 dasf ave" 'line_one
premisesRS("line_two") = "5" 'line_two
premisesRS("city") = "Deer Park" 'city
premisesRS("state_abrv") = "NY" 'state_abrv
premisesRS("zipcode") = "11729" 'zipcode
premisesRS("country_abrv") = "USA" 'country_abrv

customerDataMap = newAccountMap.At(502)
customerRS = customerDataMap.At(300)
'customerContactMethodRS = customerDataMap.At(301)
'customerAuthorizationRS = customerDataMap.At(302)

customerRS.AddNew()
customerRS("title") = "Mr" 'title
customerRS("first_name") = "kt" 'first_name
customerRS("last_name") = "kt" 'last_name

companyRS = newAccountMap.At(504)
companyRS.AddNew()
companyRS("company_name") = "kt21"
companyRS("company_legal_name") = "kt21"
companyRS("group_name") = "kt21"

importAccountMgt = CreateObject("COMXImportMgt.COMXImportAccountMgt.1")
AccountId = importAccountMgt.ImportNewAccountFull(newAccountMap, 0, "", False, True)

ImportAccount = AccountId




---------------------MY ATTEMP-----------------

<cfobject type="com"
name="importAccountMgt"
class="COMXImportMgt.COMXImportAccountMgt.1"
action="create">

<cfobject type="COM"
name="accountRS"
class="ADODB.Recordset"
action="CREATE">

<cfset newAccountMap=importAccountMgt.BlankImportAccountFull()>
<cfset accountDataMap = newAccountMap.At(500)>
<cfset accountRS = accountDataMap.At(108)>
<!---<cfset accountRS.AddNew()>
<cfdump var="#accountRS#">
<cfabort>--->
<cfset columns = "opened_datetime,status_code,payment_type_code,bill_cycle,primary_vendor_id,account_type_code">
<cfset accountRS = querynew(columns)>
<cfset queryaddrow(accountRS, 1)>
<cfset querysetcell(accountRS, "opened_datetime",now(), 1)>
<cfset querysetcell(accountRS, "status_code","PROSPECT", 1)>
<cfset querysetcell(accountRS, "payment_type_code","DIR", 1)>
<cfset querysetcell(accountRS, "bill_cycle",1, 1)>
<cfset querysetcell(accountRS, "primary_vendor_id",1, 1)>
<cfset querysetcell(accountRS, "account_type_code","CO", 1)>

<cfset premisesDataMap = newAccountMap.At(501)>
<cfset premisesRS = premisesDataMap.At(200)>
<cfset columns = "line_one,line_two,city,state_abrv,zipcode,country_abrv">
<cfset premisesRS = querynew(columns)>
<cfset queryaddrow(premisesRS, 1)>
<cfset querysetcell(premisesRS, "line_one","5165798686", 1)>
<cfset querysetcell(premisesRS, "line_two","5165798686", 1)>
<cfset querysetcell(premisesRS, "city", "Deer Park", 1)>
<cfset querysetcell(premisesRS, "state_abrv","NY", 1)>
<cfset querysetcell(premisesRS, "zipcode","11729", 1)>
<cfset querysetcell(premisesRS, "country_abrv","USA", 1)>

<cfset customerDataMap = newAccountMap.At(502)>
<cfset customerRS = customerDataMap.At(300)>
<cfset columns = "title,fist_name,last_name">
<cfset customerRS = querynew(columns)>
<cfset queryaddrow(customerRS, 1)>
<cfset querysetcell(customerRS, "title","kt", 1)>
<cfset querysetcell(customerRS, "fist_name","kt", 1)>
<cfset querysetcell(customerRS, "last_name", "kt", 1)>

<cfset companyRS = newAccountMap.At(504)>
<cfset columns = "company_name,company_legal_name,group_name">
<cfset companyRS = querynew(columns)>
<cfset queryaddrow(companyRS, 1)>
<cfset querysetcell(companyRS, "company_name","kt1", 1)>
<cfset querysetcell(companyRS, "company_legal_name","kt1", 1)>
<cfset querysetcell(companyRS, "group_name", "kt1", 1)>

<cfset AccountId = importAccountMgt.ImportNewAccountFull(newAccountMap, 0, "", False, True)>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top