• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

dmcbrier
#1 Posted : Thursday, July 15, 2010 5:10:48 PM(UTC)
dmcbrier

Rank: Member

Joined: 8/25/2007(UTC)
Posts: 124

Hello all --- :cool: Hot a heck today in the North East. Good day to stay inside working!




I have set out to show cost on the BVAdmin/Orders/ViewOrder.aspx View for our customer service rep who is processing orders. This added field would be very helpful. To start I [2]tryed to modify the BVAdmin/Orders/ViewOrder.vbx with the following code.... However lineItem.SiteCost does not exist.. [/2]

[2][/2]

[color=#0000ff></FONT>

[/color][/2][/color][2]String[/2][2]"{0:c}"[/2][2]nd[/2][2]If[/2]

[2][/2]

[2][/2]

[2]How can I grab the SiteCost Field for an item? [/2]

[color=#0000ff>

<FONT][2]Any help would be greatly appreicated. [/2][/color][2]
[/2]
dmcbrier
#2 Posted : Friday, July 16, 2010 1:22:28 PM(UTC)
dmcbrier

Rank: Member

Joined: 8/25/2007(UTC)
Posts: 124

Anyone?
Narrowpath
#3 Posted : Friday, July 16, 2010 10:18:53 PM(UTC)
Narrowpath

Rank: Member

Joined: 9/20/2006(UTC)
Posts: 92

SiteCost is not a member of the lineItem class. You would need to access the sitecost property using Catalog.Product.



Feel free to contact us via phone or email if you need assistance.



Wallace Miller -- Narrowpath Design
Providing installation, custom development, and design services for BVC5 sites
24/7 tech support and consultation service available for BVSoftware E-Commerce
760.728.8679 (phone)
[email protected]
bvcoder
#4 Posted : Saturday, July 17, 2010 9:14:17 PM(UTC)
bvcoder

Rank: Member

Joined: 8/1/2007(UTC)
Posts: 310

The following should ideally work:

Dim ourcost As Label = e.Row.FindControl("SiteCostField")
If ourcost IsNot Nothing Then
' Retrieve the product corresponding to the specific line item
Dim item As Catalog.Product = Catalog.InternalProduct.FindByBvin(lineItem.ProductId)

' Determine the product's SiteCost depending on the site's current culture
Dim itemCost As String = item.SiteCost.ToString("C", WebAppSettings.SiteCulture)

ourcost.Text = itemCost
End If

Let me know how it goes.

Thanks!
Thanks,
Satya
support @ bayquel.net
Work: +1 803 883 3226
dmcbrier
#5 Posted : Friday, July 23, 2010 12:10:57 PM(UTC)
dmcbrier

Rank: Member

Joined: 8/25/2007(UTC)
Posts: 124

This worked great! Thank you so much for taking the time to type that out.

I added the following to ViewOrder.aspx
<asp:TemplateField HeaderText="Cost">
<ItemTemplate>
<asp:Label ID="SiteCostField" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>


I added the following to ViewOrder.aspx.vb

'Added the following -- Goal - Wanted to show cost.
Dim ourcost As Label = e.Row.FindControl("SiteCostField")
If ourcost IsNot Nothing Then
' Retrieve the product corresponding to the specific line item
Dim item As Catalog.Product = Catalog.InternalProduct.FindByBvin(lineItem.ProductId)

' Determine the product's SiteCost depending on the site's current culture
Dim itemCost As String = item.SiteCost.ToString("C", WebAppSettings.SiteCulture)

ourcost.Text = itemCost
End If
' End Added Material

Off and running! Thank you, Thank you, Thank you.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012