Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: How canl I Retrieving CustomerID?

  1. #1
    dejobo is offline Junior Member
    Join Date
    Apr 2011
    Posts
    2

    Default How canl I Retrieving CustomerID?

    please does anyone knows how to retrieve Current Logged in customerId. Will like to use it to query the datase using SQL.

  2. #2
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    Here's an example from an xmlpackage :-


    HTML Code:
        <query name="Customer" rowElementName="Item">
            <sql>
                <![CDATA[
                SELECT * FROM Customer WHERE CustomerID = @CustomerID
                ]]>
            </sql>
            <queryparam paramname="@CustomerID" paramtype="system" requestparamname="CustomerID" sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
        </query>


    TTFN

    BFG

  3. #3
    dejobo is offline Junior Member
    Join Date
    Apr 2011
    Posts
    2

    Default

    Thanx for ur help. isnt there anyway I can retrieve it programatically using c#?

  4. #4
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    If you look at the source of pages such as checkoutpayment.aspx.cs, you'll see in the Page_Load() method:

    Code:
    ThisCustomer.RequireCustomerRecord();
    ...
    if (!ThisCustomer.IsRegistered)
    This allows access to the currently connected and registered customer. And you can then pass ThisCustomer.CustomerID to a SQL query.
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  5. #5
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    C#/VB.NET Code:
    Customer.Current.CustomerID 
    As long as you are using the aspdotnetstorefrontcore it should work fine.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience