Forums

This topic is locked

Saving quote for later use

Posted 25 Sep 2002 15:50:06
1
has voted
25 Sep 2002 15:50:06 Mark Shortt posted:
Hi, I want to be able to let customers spec a product and then save the quote for later use. Can anyone advise?

Replies

Replied 25 Sep 2002 16:05:59
25 Sep 2002 16:05:59 Stuart Harland replied:
Do you want to save the quote on your side, or let the customer save the quote?

If you want to save the quote you could save the information to a database, or simply save all the data to a text file which you can uniquely name & date/time stamp. This file name/path could then be stored in a database relating to the user...if your using asp as a scripting language you could do something like this example:

< %

sFullPathFile = "c:\UserQuotes\User_" & sUserName & Day(Now) & Month(Now) & Year(Now) & Hour(Now) & ".txt"

Set fsoFile = CreateObject("Scripting.FileSystemObject"
fsoFile.CreateTextFile sFullPathFile 'Create a new ForWriting file
Set fFormattedFile = fsoFile.GetFile(sFullPathFile)
Set tsText = fFormattedFile.OpenAsTextStream(ForWriting, TristateUseDefault)

tsText.WriteLine sQuoteString1 'these strings relate to lines of the quote
tsText.WriteLine sQuoteString2
tsText.WriteLine sQuoteString3
tsText.WriteLine sQuoteString4
tsText.WriteLine sQuoteString5
tsText.WriteLine sQuoteString6
tsText.WriteLine sQuoteString7
tsText.WriteLine sQuoteString8
tsText.WriteLine sQuoteString9

tsText.Close

' then save sFullPathFile, the date and the usersname to a database so when the user wants to view their old quotes they can pull the data straight from the database, then read the data from the textfile for presentation on your asp page.

% >

e.g. for sQuoteString popluation
sQuoteString1 = "Item One: " & sItem & " " & sPrice
sQuoteString2 = "Item Two: " & sItem2 & " " & sPrice2
sQuoteString1 = "Item Three: " & sItem3 & " " & sPrice3

********************
wheatNOTmeat

Reply to this topic