CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > starter_kits_and_source_projects.commerce_starter_kit Tags:
Item Type: Date Entered: 3/16/2004 1:16:54 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 2 Views: 27 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
"OneIdesigned"
NewsGroup User
How do I GetCustomerDetails to show up in Email?3/16/2004 1:16:54 AM

0

Hello,

Sorry for reposting this but I see that there is a lock on it preventing anyone from replying to it..


I need some help trying to solve why I can't get the fullname output value of from the CustomerDB to show up in the email portion of the checkout.aspx.. please I need a bit of direction. This one error that I get. All I want is to see how I can get the data using the existing code or some of it to display the fullname in the email.

Error:

E:\Program Files\ASP.NET Starter Kits\ASP.NET Commerce (VBSDK)\CommerceVBSDK\Checkout.aspx(69) : error BC30455: Argument not specified for parameter 'customerID' of 'Public Function GetCustomerDetails(customerID As String) As ASPNET.StarterKit.Commerce.CustomerDetails'.

Dim FullName = CustomersDB.GetCustomerDetails.myCustomerDetails.FullName.Value
"blueshader" <>
NewsGroup User
Re: How do I GetCustomerDetails to show up in Email?3/19/2004 5:33:21 AM

0

You have to create a CustomerDetails object first to get the name.
Here is how you can do it.

' First you have to create a customer object
Dim mCustomer As Commerce.CustomersDB = New Commerce.CustomersDB()

' Second: Create a CustomerDetail object, its in CustomersDB as well and this class holds
' all the information returned by GetCustomerDetails() Function
' Pass the CustomerID all the information
Dim mCustomerDetails As Commerce.CustomerDetails = mCustomer.GetCustomerDetails(customerID)

Dim FullName as String
FullName = mCustomerDetails.FullName

Hope this helps.
TechyGuy
"OneIdesigned"
NewsGroup User
Re: How do I GetCustomerDetails to show up in Email?3/19/2004 11:48:06 PM

0

Thanks for the reply. I finally did something like that. What I did was create a new page and copied the orderdetails into the new page along with pulling the data from a newly created view that included the information I want to to display for the customer. Then I used a html writer to write the page into the body of the confirming email, I thought this would be a good way of being consistent with how the email and the confirmation page looks.

Here is the code that I used.



Sub Page_Load(Sender As Object, E As EventArgs)



'create a string writer

Dim stringWrite As New System.IO.StringWriter

'create an htmltextwriter which uses the stringwriter

Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite)

'Dim OrderIDSent As String = Request.QueryString("OrderId")
Dim OrderIDSent As String = 113


' TODO: Update the ConnectionString and CommandText values for your application
Dim myConnection1 As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))

Dim myConnection2 As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))

Dim CommandText1 As String = "SELECT CustomerId, OrderId, FullName, EmailAddress, FirstName, MiddleName, Lastname, CompanyName, Address1, Address2, Town, State, Zip, Phone, OrderDate, Shipdate from V_Orders Where OrderID = '" & OrderIDSent & "' order by [OrderId]"

Dim CommandText2 As String = "SELECT ProductId, Quantity, UnitCost, ModelName, CategoryName from V_OrderDetails Where OrderID = '" & OrderIDSent & "' order by [OrderId]"

Dim myCommand1 As New SqlCommand(CommandText1, myConnection1)
Dim myCommand2 As New SqlCommand(CommandText2, myConnection2)

myConnection1.Open()

Dim dr1
dr1 = myCommand1.ExecuteReader(CommandBehavior.CloseConnection)


myConnection2.Open()
Dim dr2
dr2 = myCommand2.ExecuteReader(CommandBehavior.CloseConnection)


''''''''''''''''''''''

dr1.Read()
'While dr1.Read()

Dim strCustomerId As String = dr1("CustomerId").ToString
Dim strEmail As String = dr1("EmailAddress").ToString
Dim strFullName As String = dr1("FullName").ToString
Dim strFirstName As String = dr1("FirstName").ToString
Dim strOrderId As String = dr1("OrderId").ToString
Dim strMiddleName As String = dr1("MiddleName").ToString
Dim strLastName As String = dr1("LastName").ToString
Dim strCompanyName As String = dr1("CompanyName").ToString
Dim strAddress1 As String = dr1("address1").ToString
Dim strAddress2 As String = dr1("address2").ToString
Dim strTown As String = dr1("Town").ToString
Dim strState As String = dr1("State").ToString
Dim strZip As String = dr1("Zip").ToString
Dim strPhone As String = dr1("Phone").ToString
Dim strOrderDate As String = dr1("OrderDate").ToString
Dim strShipDate As String = dr1("ShipDate").ToString

lblFullName.text = dr1("FullName").ToString
lblFirstName.text = strFirstName.ToString
lblMiddleName.text = strMiddleName.ToString
lblLastName.text = strLastName.ToString
lblCompanyName.text = strCompanyName.ToString
lblAddress1.text = strAddress1.ToString
lblAddress2.text = strAddress2.ToString
lblTown.text = strTown.ToString
lblState.text = strState.ToString
lblZip.text = strZip.ToString
lblPhone.text = strPhone.ToString


Dim mail As New MailMessage()
mail.To = Email.text '<--------make a textbox called Email
mail.bcc = Email.text '<-------Email to you letting you know of the order
mail.From = "From email goes here" '<-----can be whatever you want it to look like it's coming from
mail.Subject = "Receipt for your order " & strOrderId '<-----So it sends the Order ID to them
mail.BodyFormat = MailFormat.Html


While dr2.Read()

Dim strProductId As String = dr2("ProductId").ToString
Dim strQuantity As String = dr2("Quantity").ToString
Dim strUnitCost As String = dr2("UnitCost").ToString
Dim strModelName As String = dr2("ModelName").ToString
Dim strCategoryName As String = dr2("CategoryName").ToString


mail.Body = "Customer's Full Name: " & strFullName & "<br>" _
& "First Name: " & strFirstName & "<br>" _
& "Middle Name: " & strMiddleName & "<br>" _
& "Last Name: " & strLastName & "<br>" _
& "Company Name: " & strCompanyName & "<br>" _
& "Address 1: " & strAddress1 & "<br>" _
& "Address 2: " & strAddress2 & "<br>" _
& "Town: " & strTown & "<br>" _
& "State: " & strState & "<br>" _
& "Zip: " & strZip & "<br>" _
& "Phone: " & strPhone & "<br>" _
& "Email: " & strEmail & "<br>" _
& "Order: " & strOrderId & "<br>" _
& "Order Date: " & strOrderDate & "<br>" _
& "Ship Date: " & strShipDate & "<br>" _
& "<TR><TD>" & strProductId & "</TD><TD>" & strQuantity & "</TD></TR>"




End While

' Obtain Order ID from QueryString
'Dim OrderID As Integer = CInt(Request.Params("OrderID"))
Dim OrderID As Integer = OrderIDSent

' Get the customer ID too
'Dim CustomerId As String = User.Identity.Name
Dim CustomerId As String = strCustomerId

' Obtain Order Details from Database
Dim orderHistory As ASPNET.StarterKit.Commerce.OrdersDB = New ASPNET.StarterKit.Commerce.OrdersDB()
Dim myOrderDetails As ASPNET.StarterKit.Commerce.OrderDetails = orderHistory.GetOrderDetails(OrderID, CustomerId)

' if order was found, display it
If Not (myOrderDetails Is Nothing) Then

' Bind Items to GridControl
GridControl1.DataSource = myOrderDetails.OrderItems
GridControl1.DataBind()

' Update labels with summary details

lblTotal.Text = String.Format("{0:c}", myOrderDetails.OrderTotal)
lblOrderNumber.Text = OrderID.ToString()
lblOrderDate.Text = myOrderDetails.OrderDate.ToShortDateString()
lblShipDate.Text = myOrderDetails.ShipDate.ToShortDateString()


detailsTable.RenderControl(htmlWrite)
Dim strHtml = stringWrite.ToString()
mail.Body = strHtml
SmtpMail.SmtpServer = "Put your mail server here" ' <------localhost works if it's on the same as your mail server
SmtpMail.Send(mail)


Else
' otherwise display an error message
MyError.Text = "Order not found!"
detailsTable.Visible = False

End If


End Sub


3 Items, 1 Pages 1 |< << Go >> >|


Free Download:













clustered vm resource(server)

after failover mapping points to wrong volume

nic teaming hp dl360 g5 with cluster service - bx2 nics

san migration

any folks have detailed document of oes ncs ?

error in imanager with cluster management

cluster fatal 9054 can't find default route

odd cluster behavior

virtual ncp server object slp advertising

oes linux missing cluster templates

migration utility

ncs without shared storage

clustering iprint oes2sp1 linux cluster

amd or intel processor?

cluster resource goes comatose

sbd partition on drbd

unable to mount clustered nss volumes

zenworks 7 sp1 install on cluster: lacking docs

cluster services access error in imanager

expanding netware 6.5sp8 cluster with sles10

moving resources from one cluster to another

abend - at least one of the nodes is alive in the old master's node partition

equallogic volume snapshots

ncs resource does not migrrate

clustering intranet

can't add new servers to existing cluster

moving iscsi san to separate nics

configuration cluster 2 nodes oes 2 linux

remove clustering from oes2 linux

savin copier no access cluster volume

clustering ftp active/active on nw65sp7?

nw65sp7 - abend during backup

cluster resource in unassigned state

cluster-<info>-<211>: wsasetservice() failed, error = -1

master ip stops responding - oes2 sp1 linux cluster

using two iscsi targets for redundancy

moving cluster to new san

migrating oes 1 (linux) cluster to new san

how to delete old sbd partition

groupwise 7 cluster resource comatose

no server object with running volumes in nds

error in evmsgui, can't save changes!

length of load/unlaod scripts must be less then 924 characters

ifolder3 and iprint on same oes2/l cluster?

replicas on cluster servers?

netware 6.5 sp5 cluster problem

newbie question about trustees on cluster volumes

adminfs: error 21702 from the write function

gw7 cluster w/oes2 linux on shared ext3 filesystem

removing crashed cluster node from nds

   
  Privacy | Contact Us
All Times Are GMT