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 4 of 4

Thread: Automating processes outside of the web to use Store code?

  1. #1
    plibby is offline Junior Member
    Join Date
    Oct 2011
    Posts
    2

    Question Automating processes outside of the web to use Store code?

    We would like to create a windows service (or scheduled task) to automate some special order processing.

    1). Is this even possible?

    2). Is there a recommended way to accomplish external processes?

    Thanks

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

    Default

    There are many ways of doing it. We have a number of .ashx pages which are called from windows schedule items.
    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!

  3. #3
    sduffy77 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Lancaster, PA
    Posts
    142

    Default

    Quote Originally Posted by esedirect View Post
    There are many ways of doing it. We have a number of .ashx pages which are called from windows schedule items.
    Interesting, can you give more details?

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

    Default

    Here's the content of an .ashx page that is scheduled to run every day at 11:30 on our webserver:

    Code:
    <%@ WebHandler Language="C#" Class="YourPageNameHere" %>
    
    using System;
    using System.Web;
    using System.Data.SqlClient;
    using AspDotNetStorefrontCore;
    
    public class YourPageNameHere: IHttpHandler {
        
        public void ProcessRequest (HttpContext context) {
            DB.ExecuteSQL("EXEC YourSPNameHere");
    		context.Response.Write("<root>This page is scheduled to run every day @11:30 and will auto-close after 2 mins.</root>");
        }
     
        public bool IsReusable {
            get {
                return false;
            }
        }
    
    }
    As you can see it outputs some text to the calling application, in this case IE, and it runs a stored procedure on the server. The scheduler closes the IE session after 2mins. Actually it could close it immediately because the sp returns nothing to the IE window.

    I've changed the names to protect the innocent!
    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!