Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 05:43
    Daniel Bardi
    0

    Can't find the easiest way to get all orders using .Net API

    Been awhile since I dipped into TeaCommerce.  What is the quickest way, using the .Net API, get all the orders.

    I know how to get a single order, but need to get ALL using the API.

    Thanks in advance.

  • Rune Grønkjær 1372 posts 3103 karma points
    Mar 25, 2011 @ 06:13
    Rune Grønkjær
    1

    Good morning Daniel,

    You only have one option on this at the moment. All finalized orders can be fetched with the Tea Commerce library method

     

    TeaCommerce.Library.GetFinalizedOrdersXml();

    You can also get all orders for a specific member like this.

    TeaCommerce.Library.GetFinalizedOrdersXmlForMember(int memberId);

    But the return type is an XPathNodeIterator so you wont be able to save them. If you want that you need to get the ones you want by id afterwards.

    /Rune

  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 06:19
    Daniel Bardi
    0

    I saw that and was afraid that I might have to iterate the nodes.. looks like that's what I'll be doing.

    No problem.. done it before.

    I'm doing this in order to expose them via a webservice for an external POS system that will be syncing with online orders.

    Thanks!

  • Rune Grønkjær 1372 posts 3103 karma points
    Mar 25, 2011 @ 06:24
    Rune Grønkjær
    0

    You don't have to wory about performance on those two. We have made a xml file with all finalized orders and is just dumping that. So it's super fast. The xml file is updated everytime a finalized order is saved, so it will allways have the newest updates and orders.

    Performance is our main concern for not havin a GetAllOrders method right now. We are in the thinking process of finding the best way to do it. Until then you can use the above mentioned.

    /Rune

  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 06:36
    Daniel Bardi
    0

    Why not just have the GetAllOrders method iterate the XML dump and return a generic list of order objects.. no database connection needed.. should be fast.

    Anyway I should be able to just send the xml back throw the webservice, right?  The POS system can parse it and do whatever.

    Thanks again.

  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 06:42
    Daniel Bardi
    0

    This is what I get when I try your solution:

    It only shows TeaCommerce.Library.GetFinalizedOrderXml(); (SINGULAR.. NOT PLURAL)

  • Rune Grønkjær 1372 posts 3103 karma points
    Mar 25, 2011 @ 06:47
    Rune Grønkjær
    0

    Have you updated to the latest Tea Commerce version. These methods are somewhat new.

    Remember that you can just install the newest package. It won't destroy any settings.

    I didn't get what you meant by this:
    "Anyway I should be able to just send the xml back throw the webservice, right?"

    /Rune

  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 06:57
    Daniel Bardi
    0

    I'll check the assembly version.. thought I had latest.

    I meant that I can just send the return value from the method ... but doesn't look that I can.. I'll get it working somehow.

    Thanks again.

  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 07:01
    Daniel Bardi
    0

    I checked and I downloaded the version on Our... Not getting TeaCommerce.Library.GetFinalizedOrdersXml();

  • Rune Grønkjær 1372 posts 3103 karma points
    Mar 25, 2011 @ 07:09
    Rune Grønkjær
    0

    Hm, that can't be true. And you have the newest TeaCommerce.dll in you VS project? It's working like a charm for me here.

    What version does it say in Developer --> Packages --> Installed Packages --> TeaCommerce?

    /Rune

  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 07:19
    Daniel Bardi
    0

    Not running from an installed package.. just referencing the assemblies in VS2010.

    Went to TeaCommerce project page on Our

    Downloaded package for .Net4.0 (dated 3/14/2011)

    Extracted and referenced from project

  • Rune Grønkjær 1372 posts 3103 karma points
    Mar 25, 2011 @ 07:55
    Rune Grønkjær
    0

    Argh, that really bothers me. :)

    I did exactly that now and I got this

    I will ask Anders when he shows up at work in a moment. Maybe he can give us a new perspective. I don't know if you did, but maybe you could start a whole new testproject and try the dll there. As I see it it can only be because it's an older build.

    But I will ask Anders

    /Rune

  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 08:25
    Daniel Bardi
    0

    Here's the odd thing... Class View shows the method and the project builds... but intellisense doesn't show it... might be a caching thing.. I'm using Resharper intellisense.

    Go figure.

  • Rune Grønkjær 1372 posts 3103 karma points
    Mar 25, 2011 @ 08:30
    Rune Grønkjær
    0

    Ahh, There we are. Mystery solved :)

    Glad you found the problem.

    Looking forward to se your setup when it's done. Sounds like a good case. Will it be public?

    /Rune

  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 08:36
    Daniel Bardi
    0

    It's the clients proprietry POS.. site will be public.. If it works out nicely, I'll post something in the forum.

    Client runs a brick and morter Spa.. I'm using TeaCommerce for them to accept online appointments.

    Each service is listed as a product on the site.. I use DDay.iCal to find availability for selected services.. if availablity is scheduled, the service is added to the cart.

    The POS/Scheduler will connect to the webservice to pull down orders (i.e. purchased services) for syncing.

  • Anders Burla 2560 posts 8256 karma points
    Mar 25, 2011 @ 08:38
    Anders Burla
    1

    Wow that sounds like a really cool use of Tea Commerce! I will definitely try and order an appointment at that Spa :)

  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 08:44
    Daniel Bardi
    0

    It's been a challenge.. was on hold for several months.. on the front burner again.. I'll definitely post about it when done.

    Thanks for all your help.

  • Rune Grønkjær 1372 posts 3103 karma points
    Mar 25, 2011 @ 08:55
    Rune Grønkjær
    0

    Cool. Nice to see people bend and twist your product. Be free to write here again if you run into more difficulties.

    /Rune

  • Matt Taylor 873 posts 2086 karma points
    Jul 14, 2011 @ 17:32
    Matt Taylor
    0

    I need to get the details of the 3 most recently completed orders for display on the homepage. :)

    Is there a .Net method yet other than the one that returns XPathNodeIterator?
    No problem if there isn't, just I'm not familiar with XPathNodeIterator thingies. I expect they are easy enough to deal with but it'll be something else I'll have to go off an learn and my brain hurts enough already. ;-)

    Regards,

    Matt

  • Rune Grønkjær 1372 posts 3103 karma points
    Jul 15, 2011 @ 08:52
    Rune Grønkjær
    1

    Hi Matt,

    There's no method of getting all finalized orders in the .NET API yet. It's on our wish list, but we are worried about performance. You will have to use the Library.GetFinalizedOrdersXml() method.

    If your take "Current" on the XPathNodeIteratoryou will get anXPathNavigator onwhich you can call the Select() method with an xpath parameter. Then you can find the orders you need, get their ID's and THEN you can call the razor method GetOrder(long id)

    Much easier just to do it in your xslt's :)

    /Rune

  • Matt Taylor 873 posts 2086 karma points
    Jul 15, 2011 @ 10:37
    Matt Taylor
    0

    You're right, I realised what I wanted to do suited and XSLT macro perfectly so went that way.

    Cheers, Matt

Please Sign in or register to post replies

Write your reply to:

Draft