Appearance
C# Interface
Copy the following interface and save to a file called FlowAPI_Intf.cs
WARNING
Edit the line containing the database connection details to point the API at your configuration database. Alternatively devise your own DoLogin() procedure that calls the Flo_Login() function.
Boolean result = FlowAPI.Flo_Login("localhost\\Flow", "_Playground", "sa", "F1owsq1!");
WARNING
You will need to modify the references to "c:\\program files\\flow software\\FlowAPI.dll" to point to the location you use. It is possible to use a relative reference.
csharp
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Runtime.InteropServices;
using System.Text;
namespace Flow.API
{
public delegate void TExecuteCallBackEvent(string ActionFID, bool Success);
public static class FlowAPI
{
public static bool DoLogin()
{
try
{
//this license check is a helper. if you remove it you will still not be
//able to use it without a valid license. this is because the API will do its own
//license check internally.
if (!FlowAPI.Flo_IsLicenseOk())
throw new Exception("FlowAPI is not licensed. Please obtain a software license using Flow console");
//change the below Flo_Login call to have the correct details for your configuration database.
//Param1 = enter the host name of your sql server in the form <computername>\<instancename> (instance is
optional) (usee double backslash as \ is a control character by itself)
//Param2 = name of the database on that sql server
//Param3 = SQL Server username - leave blank to use Windows Authentication. do not put your windows username in
here
//Param4 = Password for above SQL server username - leave blank to use Windows Authentication. do not put your
windows password in here.
Boolean result = FlowAPI.Flo_Login("localhost\\Flow", "_Playground", "sa", "F1owsq1!");
return result;
}
catch (Exception ex)
{
throw ex;
}
}
public static bool DoLogout()
{
try
{
Boolean result = FlowAPI.Flo_Logout();
return result;
}
catch (Exception ex)
{
throw ex;
}
}
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_IsLicenseOk();
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_Login(string Hostname, string Database, string Username, string Password);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_Logout();
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_AboutAPI(string Description);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern int Flo_AboutAPIEx(out string Description, int length);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_ExecuteAction(string ActionFID, TExecuteCallBackEvent CallBack);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_ExecuteActionSync(string ActionFID);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_ExecuteActionWithParams(string ActionFID, string InputParams, TExecuteCallBackEvent
CallBack);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_ExecuteActionSyncWithParams(string ActionFID, string InputParams);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_ExecuteActionResultWithParams(string ActionFID, string InputParams, out Object
ResultStream);//ResultStream is a OleVariant
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_ExecuteSOAPRequestOut(string ActionFID, string InputParams, StringBuilder aXML);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_ExecuteSOAPRequestIn(string ActionFID, string aXML);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_TestDBCon(string DBFID);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_SaveDBCon(ref string aXML, ref string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_SaveFileCon(ref string aXML, ref string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_SaveDBDef(ref string aXML, ref string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_SaveFileDef(ref string aXML, ref string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_SaveReport(ref string aXML, ref string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_SaveMap(ref string aXML, ref string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_SaveTransport(ref string aXML, ref string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_SaveAction(ref string aXML, ref string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_SaveTradingPartner(ref string aXML, ref string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_SaveLog(ref string aXML, ref string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_LoadDBCon(string aFID, out string aXML, out string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_LoadFileCon(string aFID, out string aXML, out string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_LoadDBDef(string aFID, out string aXML, out string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_LoadFileDef(string aFID, out string aXML, out string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_LoadReport(string aFID, out string aXML, out string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_LoadMap(string aFID, out string aXML, out string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_LoadTransport(string aFID, out string aXML, out string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_LoadAction(string aFID, out string aXML, out string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_LoadTradingPartner(string aFID, out string aXML, out string aXML2);
[DllImport("c:\\program files\\flow software\\FlowAPI.dll")]
public static extern bool Flo_LoadLog(string aFID, out string aXML, out string aXML2);
}
}