Hi,
I'm Tarun.. I'm working as a core programmer.
I've a medical ebook portal in which user can also order COD(cash-On-Delivery).And, the portal is running on VB.net platform. Now, the problem is that when a user goes for COD order then discounted amount doesn't reflect in the mail content. So, i want to add discounted amount after deduct discount in email content. But we don't maintain discounted amount in our cart table (database). We maintain only book price and total order amount in cart table. and i also want to add shipping charge in total payable amount including discounted amount.
Please find below mentioned my code:
Private Sub prcSaveData()
Try
'Add Author detail on 17th July 2015
VppOrderDetail = "Order Id: " & Session("SesID")
Dim D_amt As String
Dim totalpay As String
Dim totalpaywithPromo As String
If (Session("PromoCode") = "") Then
Dim shippingcharge As Integer
Dim totalbookprice As Integer
shippingcharge = totalbookprice / 10
totalpay = shippingcharge + totalbookprice
D_amt = ""
'Dim totalpaywithPromo As String
Dim promoDiscPrice As String
'Dim DisAmount As String
promoDiscPrice = Session("promoDiscPrice")
promoDiscPrice = totalpay / 10
totalpaywithPromo = totalpay - promoDiscPrice
'D_amt = totalpaywithPromo
End If
CmdTmp2 = New OleDbCommand("spTmpDetails2", Con)
CmdTmp2.CommandType = CommandType.StoredProcedure
CmdTmp2.Parameters.AddWithValue("@SID", Session("SesID"))
Rs = CmdTmp2.ExecuteReader
While Rs.Read()
CmdInsetCart = New OleDbCommand("spInsertCart", Con)
CmdInsetCart.CommandType = CommandType.StoredProcedure
CmdInsetCart.Parameters.AddWithValue("@SID", Session("SesID"))
CmdInsetCart.Parameters.AddWithValue("@UN", txtUName.Text)
CmdInsetCart.Parameters.AddWithValue("@PID", Rs("ISBN").ToString)
CmdInsetCart.Parameters.AddWithValue("@Name", Rs("Title").ToString)
CmdInsetCart.Parameters.AddWithValue("@Desc1", Rs("Author").ToString)
CmdInsetCart.Parameters.AddWithValue("@Price", Rs("Price"))
CmdInsetCart.Parameters.AddWithValue("@Qty", Rs("Qty"))
CmdInsetCart.Parameters.AddWithValue("@Amt", Rs("Amt"))
CmdInsetCart.Parameters.AddWithValue("@Status", "VPPOrder")
CmdInsetCart.Parameters.AddWithValue("@PDate", Date.Now())
CmdInsetCart.ExecuteReader()
VppOrderDetail = VppOrderDetail & vbCrLf & "ISBN: " & Rs("ISBN").ToString & vbCrLf & "Title: " & Rs("Title").ToString & vbCrLf & "Author: " & Rs("Author").ToString & vbCrLf & "Price: " & Rs("Price").ToString & vbCrLf & "QTY: " & Rs("Qty").ToString & vbCrLf & "Amount: " & Rs("Amt").ToString & vbCrLf & "Order Date: " & Date.Now()
'VppOrderDetail = VppOrderDetail & vbCrLf & "Total Amount to be paid: " & totalpaywithPromo
End While
Catch ex As Exception
End Try
End Sub