This commit is contained in:
BIN
API/CSHelloAyaNova/App.ico
Normal file
BIN
API/CSHelloAyaNova/App.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
58
API/CSHelloAyaNova/AssemblyInfo.cs
Normal file
58
API/CSHelloAyaNova/AssemblyInfo.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified, the assembly is not signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||
// a key.
|
||||
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the KeyFile is installed into the CSP and used.
|
||||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||
// When specifying the KeyFile, the location of the KeyFile should be
|
||||
// relative to the project output directory which is
|
||||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
|
||||
// located in the project directory, you would specify the AssemblyKeyFile
|
||||
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
||||
229
API/CSHelloAyaNova/Form1.cs
Normal file
229
API/CSHelloAyaNova/Form1.cs
Normal file
@@ -0,0 +1,229 @@
|
||||
/*
|
||||
* HelloAyaNova - Developers API sample application
|
||||
*
|
||||
* Illustrates the absolute basics of connecting to the AyaNova
|
||||
* business object framework, creating an saving an object and
|
||||
* retrieving it.
|
||||
*
|
||||
* Areas outlined with //******** blocks are AyaNova specific
|
||||
*
|
||||
* Note the 6 references added to this project. Those 6
|
||||
* references are required to work with the AyaNova API.
|
||||
*
|
||||
* The referenced .dll files are the same files found in the AyaNova
|
||||
* program folder when AyaNova is installed. If you did not install
|
||||
* your test copy of AyaNova to the default folder you may need to update those
|
||||
* references
|
||||
*
|
||||
* When a new version of AyaNova is released you simply need refresh your references and rebuild your
|
||||
* application to maintain compatibility
|
||||
*
|
||||
* */
|
||||
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
|
||||
//******* SAMPLE ********************
|
||||
//The AyaNova business object library:
|
||||
using GZTW.AyaNova.BLL;
|
||||
|
||||
//The security library required for
|
||||
//processing the login
|
||||
using CSLA.Security;
|
||||
|
||||
//Used for login confirmation
|
||||
using System.Threading;
|
||||
//*************************************
|
||||
|
||||
|
||||
namespace HelloAyaNova
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Form1.
|
||||
/// </summary>
|
||||
public class Form1 : System.Windows.Forms.Form
|
||||
{
|
||||
private System.Windows.Forms.Button button1;
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.Container components = null;
|
||||
|
||||
public Form1()
|
||||
{
|
||||
//
|
||||
// Required for Windows Form Designer support
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
//
|
||||
// TODO: Add any constructor code after InitializeComponent call
|
||||
//
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
protected override void Dispose( bool disposing )
|
||||
{
|
||||
if( disposing )
|
||||
{
|
||||
if (components != null)
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
}
|
||||
base.Dispose( disposing );
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(103, 102);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "button1";
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
|
||||
this.ClientSize = new System.Drawing.Size(385, 253);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Form1";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
|
||||
//**************** SAMPLE ************************
|
||||
private void button1_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
//THIS IS AN EXAMPLE ONLY, YOU APPLICATION SHOULD IMPLEMENT
|
||||
//ERROR HANDLING AND RECOVERY AND CHECK FOR EXCEPTIONS
|
||||
|
||||
|
||||
|
||||
//The call to Initialize is always the first required in any
|
||||
//application working with AyaNova, it initializes the database
|
||||
//connection and business object framework and confirms operations can
|
||||
//take place
|
||||
|
||||
//IMPORTANT: If you receive an exception when calling the Initialize method it is most likely
|
||||
//a connection string problem in your config.txt file causing the
|
||||
//database provider to throw a not found exception. Or a problem with the configuration
|
||||
//file itself like it's missing or not configured properly.
|
||||
|
||||
//Remember that in the case of any exception using the AyaNova business object library
|
||||
//it is that exception's Inner exception which is most likely the actual error (if present)
|
||||
//because AyaNova objects are invoked through a factory method which wraps any actual exception
|
||||
//generated by the business object inside a TargeInvocationException
|
||||
|
||||
try
|
||||
{
|
||||
GZTW.AyaNova.BLL.AyaBizUtils.Initialize();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//"crack" the exception to get to the innermost exception
|
||||
while (ex.InnerException != null)
|
||||
ex = ex.InnerException;
|
||||
|
||||
MessageBox.Show(ex.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Once your application gets to this point right after Initialize without error
|
||||
//you can be assured that you have a clean configuration file and a connection
|
||||
//to the database and are ready to log in
|
||||
|
||||
|
||||
//This is the default AyaNova trial login and password
|
||||
//and this is how you login to AyaNova
|
||||
AyaBizUtils.Login("manager","letmein");
|
||||
|
||||
//confirm the user is logged in:
|
||||
if(Thread.CurrentPrincipal.Identity.IsAuthenticated==false)
|
||||
{
|
||||
//Nope, they are not authenticated so
|
||||
//show an error and bail out
|
||||
MessageBox.Show("Login failed");
|
||||
return;
|
||||
}
|
||||
|
||||
//at this point the user is logged in and
|
||||
//you can now work with any AyaNova business objects that
|
||||
//the login account used above has rights to.
|
||||
|
||||
//Logging OUT: There is technically no need to logout
|
||||
//simply close the program
|
||||
|
||||
//Let's just make sure the database hasn't expired
|
||||
//an expired AyaNova database is read only so
|
||||
//the code below will not work
|
||||
//AyaBizUtils handles all manner of general operations
|
||||
//that aren't related to a particular object
|
||||
if(AyaBizUtils.Expired)
|
||||
{
|
||||
MessageBox.Show("Sorry this database has an expired license: " + AyaBizUtils.ExpiryDate.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
//lets add a Client
|
||||
Client c=Client.NewItem();
|
||||
//give the client a name and ensure it's unique for testing purposes
|
||||
//by putting the current date and time after the name
|
||||
c.Name="Test client "+System.DateTime.Now.ToString();
|
||||
c.Notes="Test client created from \"Hello AyaNova\" sample API program";
|
||||
c.Save();
|
||||
|
||||
//save the ID to retrieve it later on
|
||||
//AyaNova uses Guid's for every object
|
||||
Guid gNewClientID=c.ID;
|
||||
|
||||
//some feedback to show it worked
|
||||
//fetch the newly created client back from
|
||||
//the database
|
||||
Client b=Client.GetItem(gNewClientID);
|
||||
MessageBox.Show(b.Name);
|
||||
|
||||
|
||||
//That's all there is to it.
|
||||
//If you open the database from AyaNova you will see the new
|
||||
//client ready for use.
|
||||
|
||||
//of course there are many more properties of a client that can be set
|
||||
//and many more business objects that can be worked with in a similar manner
|
||||
//check out the other samples and the developers api reference at http://api.ayanova.com/ for more information
|
||||
|
||||
}
|
||||
|
||||
//********************** END OF SAMPLE ***************************************
|
||||
|
||||
}
|
||||
}
|
||||
139
API/CSHelloAyaNova/Form1.resx
Normal file
139
API/CSHelloAyaNova/Form1.resx
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used forserialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="button1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="button1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="button1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>(Default)</value>
|
||||
</data>
|
||||
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>8, 8</value>
|
||||
</data>
|
||||
<data name="$this.Name">
|
||||
<value>Form1</value>
|
||||
</data>
|
||||
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>80</value>
|
||||
</data>
|
||||
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
</root>
|
||||
191
API/CSHelloAyaNova/HelloAyaNova.csproj
Normal file
191
API/CSHelloAyaNova/HelloAyaNova.csproj
Normal file
@@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{0A61D20D-1711-4207-8321-F5BF4C7E336B}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon>App.ico</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>HelloAyaNova</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>HelloAyaNova</RootNamespace>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<IsWebBootstrapper>true</IsWebBootstrapper>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<PublishUrl>http://localhost/HelloAyaNova/</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Web</InstallFrom>
|
||||
<UpdateEnabled>true</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>none</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CSLA, Version=4.0.1.0, Culture=neutral, PublicKeyToken=df66a8d8e49833d3, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files\Ground Zero Tech-Works Inc\AyaNova\CSLA.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="CSLA.Core.Bindablebase, Version=4.0.1.0, Culture=neutral, PublicKeyToken=df66a8d8e49833d3, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files\Ground Zero Tech-Works Inc\AyaNova\CSLA.Core.Bindablebase.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CSLA.Server.DataPortal, Version=4.0.1.0, Culture=neutral, PublicKeyToken=df66a8d8e49833d3, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files\Ground Zero Tech-Works Inc\AyaNova\CSLA.Server.DataPortal.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files\Ground Zero Tech-Works Inc\AyaNova\FirebirdSql.Data.FirebirdClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GZTW.AyaNova.BLL, Version=4.0.1.0, Culture=neutral, PublicKeyToken=df66a8d8e49833d3, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files\Ground Zero Tech-Works Inc\AyaNova\GZTW.AyaNova.BLL.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GZTW.Data, Version=4.0.1.0, Culture=neutral, PublicKeyToken=df66a8d8e49833d3, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files\Ground Zero Tech-Works Inc\AyaNova\GZTW.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GZTW.Profile, Version=4.0.1.0, Culture=neutral, PublicKeyToken=df66a8d8e49833d3, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files\Ground Zero Tech-Works Inc\AyaNova\GZTW.Profile.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing">
|
||||
<Name>System.Drawing</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms">
|
||||
<Name>System.Windows.Forms</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="App.ico" />
|
||||
<Compile Include="AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="HelloAyaNova.exe.manifest">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
71
API/CSHelloAyaNova/HelloAyaNova.csproj.user
Normal file
71
API/CSHelloAyaNova/HelloAyaNova.csproj.user
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<LastOpenVersion>7.10.3077</LastOpenVersion>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\data\AyaNova 3.1\API\AyaNova3_1\;C:\data\AyaNova 3.0\Installs\AyaNova\SourceFiles\;C:\data\AyaNova 3.0\source\WinFormApp\bin\Release\;C:\data\AyaNova 3.1\Installs\AyaNova\SourceFiles\</ReferencePath>
|
||||
<CopyProjectDestinationFolder>
|
||||
</CopyProjectDestinationFolder>
|
||||
<CopyProjectUncPath>
|
||||
</CopyProjectUncPath>
|
||||
<CopyProjectOption>0</CopyProjectOption>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
<PublishUrlHistory>
|
||||
</PublishUrlHistory>
|
||||
<InstallUrlHistory>
|
||||
</InstallUrlHistory>
|
||||
<SupportUrlHistory>
|
||||
</SupportUrlHistory>
|
||||
<UpdateUrlHistory>
|
||||
</UpdateUrlHistory>
|
||||
<BootstrapperUrlHistory>
|
||||
</BootstrapperUrlHistory>
|
||||
<FallbackCulture>en-US</FallbackCulture>
|
||||
<VerifyUploadedFiles>true</VerifyUploadedFiles>
|
||||
<ErrorReportUrlHistory />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<EnableASPDebugging>false</EnableASPDebugging>
|
||||
<EnableASPXDebugging>false</EnableASPXDebugging>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
|
||||
<RemoteDebugEnabled>false</RemoteDebugEnabled>
|
||||
<RemoteDebugMachine>
|
||||
</RemoteDebugMachine>
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>
|
||||
</StartArguments>
|
||||
<StartPage>
|
||||
</StartPage>
|
||||
<StartProgram>
|
||||
</StartProgram>
|
||||
<StartURL>
|
||||
</StartURL>
|
||||
<StartWorkingDirectory>
|
||||
</StartWorkingDirectory>
|
||||
<StartWithIE>true</StartWithIE>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<EnableASPDebugging>false</EnableASPDebugging>
|
||||
<EnableASPXDebugging>false</EnableASPXDebugging>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
|
||||
<RemoteDebugEnabled>false</RemoteDebugEnabled>
|
||||
<RemoteDebugMachine>
|
||||
</RemoteDebugMachine>
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>
|
||||
</StartArguments>
|
||||
<StartPage>
|
||||
</StartPage>
|
||||
<StartProgram>
|
||||
</StartProgram>
|
||||
<StartURL>
|
||||
</StartURL>
|
||||
<StartWorkingDirectory>
|
||||
</StartWorkingDirectory>
|
||||
<StartWithIE>true</StartWithIE>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
11
API/CSHelloAyaNova/HelloAyaNova.exe.manifest
Normal file
11
API/CSHelloAyaNova/HelloAyaNova.exe.manifest
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="HelloAyaNova" type="win32" />
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
||||
19
API/CSHelloAyaNova/HelloAyaNova.sln
Normal file
19
API/CSHelloAyaNova/HelloAyaNova.sln
Normal file
@@ -0,0 +1,19 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloAyaNova", "HelloAyaNova.csproj", "{0A61D20D-1711-4207-8321-F5BF4C7E336B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0A61D20D-1711-4207-8321-F5BF4C7E336B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0A61D20D-1711-4207-8321-F5BF4C7E336B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0A61D20D-1711-4207-8321-F5BF4C7E336B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0A61D20D-1711-4207-8321-F5BF4C7E336B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
BIN
API/CSHelloAyaNova/HelloAyaNova.suo
Normal file
BIN
API/CSHelloAyaNova/HelloAyaNova.suo
Normal file
Binary file not shown.
7
API/CSHelloAyaNova/bin/Debug/config.txt
Normal file
7
API/CSHelloAyaNova/bin/Debug/config.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<!-- Use the embedded Firebird database -->
|
||||
<ConnectionType>DataBase</ConnectionType>
|
||||
<DataBaseType>FireBird</DataBaseType>
|
||||
<DataBaseConnectionString>ServerType=1;DataBase=%AllUsersProfile%\AyaNovaData\AYANOVA.FDB;Dialect=3;</DataBaseConnectionString>
|
||||
</configuration>
|
||||
BIN
API/CSHelloAyaNova/bin/Debug/fbembed.dll
Normal file
BIN
API/CSHelloAyaNova/bin/Debug/fbembed.dll
Normal file
Binary file not shown.
BIN
API/CSHelloAyaNova/bin/Debug/firebird.msg
Normal file
BIN
API/CSHelloAyaNova/bin/Debug/firebird.msg
Normal file
Binary file not shown.
BIN
API/CSHelloAyaNova/bin/Debug/icudt30.dll
Normal file
BIN
API/CSHelloAyaNova/bin/Debug/icudt30.dll
Normal file
Binary file not shown.
BIN
API/CSHelloAyaNova/bin/Debug/icuin30.dll
Normal file
BIN
API/CSHelloAyaNova/bin/Debug/icuin30.dll
Normal file
Binary file not shown.
BIN
API/CSHelloAyaNova/bin/Debug/icuuc30.dll
Normal file
BIN
API/CSHelloAyaNova/bin/Debug/icuuc30.dll
Normal file
Binary file not shown.
189
API/Quickstart.rtf
Normal file
189
API/Quickstart.rtf
Normal file
@@ -0,0 +1,189 @@
|
||||
{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\fnil\fcharset2 Symbol;}}
|
||||
{\colortbl ;\red0\green0\blue0;}
|
||||
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\nowidctlpar\b\f0\fs24 AyaNova business object library quick start guide\par
|
||||
\par
|
||||
\fs20 This is a quick start guide for experienced developers.\par
|
||||
\par
|
||||
If you have any questions \ul after reading this guide and examining the sample applications \ulnone we will be happy to answer them on the AyaNova development forum at http://forum.ayanova.com \par
|
||||
\par
|
||||
\par
|
||||
About \par
|
||||
\par
|
||||
\b0 AyaNova is built upon the AyaNova business object library. This is a code library that handles all of the details of working with AyaNova objects such as Clients, Workorders etc.\par
|
||||
\par
|
||||
All the AyaNova programs and utilities use this shared library and you can too. The library is free for commercial or private use. In other words you can write a utility for your own shop or a program that you sell commercialy as an add-on for AyaNova. We provide free support through the forum and the api documentation.\par
|
||||
\par
|
||||
The windows AyaNova program and the asp.net WBI web interface were both built using this exact same business object library so as you can see it's quite powerful but also easy to use.\par
|
||||
\par
|
||||
The AyaNova business object library is written in and supports the .net framework 3.5 or newer. If you are not familiar with the .net framework there is a good article in Wikipedia about it: http://en.wikipedia.org/wiki/.NET_Framework\par
|
||||
\par
|
||||
\par
|
||||
\b What kind of program can I write?\b0\par
|
||||
\par
|
||||
You have two choices for developing an application for AyaNova: as a stand alone application (windows or web) or as a plugin for use from within the AyaNova program itself.\par
|
||||
\par
|
||||
\par
|
||||
\b Requirements\par
|
||||
\b0\par
|
||||
To develop an application that can work with the AyaNova business object library you need the following:\par
|
||||
\par
|
||||
Your development computer must have a working copy of AyaNova on it. Ideally just install the latest trial version which is perfect for test and development because you won\rquote t be using a live database. You do *not* need a license to develop for AyaNova, in fact you do not need to buy anything at all.\par
|
||||
\par
|
||||
This should go without saying, but we will say it anyway, do not develop an application against your live in-use AyaNova database. Testing will often require blowing away the database and mistakes are bound to happen.\par
|
||||
\par
|
||||
A .net development tool. We use Visual Studio Professional from Microsoft, however, you can use anything that supports .net\par
|
||||
Here are some free ones:\par
|
||||
Microsoft Visual Studio Express - http://www.microsoft.com/express/\par
|
||||
Sharp Develop - http://www.sharpdevelop.net/OpenSource/SD/Default.aspx\par
|
||||
\par
|
||||
Internet access to the online AyaNova API documentation at: http://api.ayanova.com\par
|
||||
\par
|
||||
\par
|
||||
\b Distributing your program\par
|
||||
\par
|
||||
\b0 Once your application is ready for release you can simply drop the executable and manifest into the AyaNova program folder if it's a stand alone application or the plugin .dll file under the plugins folder for plugins, you do not need to distribute any of the files that come with AyaNova that you used for development since these are the same files that come with AyaNova itself anyway. \par
|
||||
\par
|
||||
\par
|
||||
\b Royalties, license fees, what does it cost me to develop for AyaNova\par
|
||||
\b0\par
|
||||
Nothing. Our business is with AyaNova and we think a free an open environment for 3rd party developers can only be a good thing for our customers. \par
|
||||
\par
|
||||
\par
|
||||
\b Integrating other applications with AyaNova\par
|
||||
\b0\par
|
||||
AyaNova business object library has built in integration objects that are provided just for the purpose of 3rd party developers integrating other applications with AyaNova. It's the same objects that our own add-on products such as QBI and PTI use to store the data that helps them integrate between AyaNova and QuickBooks and Peachtree. We encourage developers to have a look at these objects and take advantage of them if they will be beneficial.\par
|
||||
See the developers API documentation at http://api.ayanova.com and have a look at the objects that start with the word "Integration" for more details.\par
|
||||
\par
|
||||
\b Programming languages supported\par
|
||||
\par
|
||||
\b0 The AyaNova business object library was coded to conform to .net Common Language Infrastructure standards and as such you should have no problem \par
|
||||
using the .net framework language of your choice. We code primarily in C#, but that has no relevance on what language\par
|
||||
you may choose to use, the AyaNova business objects are language agnostic, you can use any of the following:\par
|
||||
C++ (managed, i.e. .net)\par
|
||||
C#\par
|
||||
Visual Basic .Net\par
|
||||
J# - Java for .net\par
|
||||
Or anything else that supports .net\par
|
||||
\par
|
||||
A complete list can be found here:\par
|
||||
http://en.wikipedia.org/wiki/CLI_Languages\par
|
||||
\par
|
||||
Our examples will be primarily in C# with a limited number in Visual Basic.net however the concepts are the same and the code will be\par
|
||||
almost identical when it relates to the AyaNova business objects.\par
|
||||
\par
|
||||
\par
|
||||
\b In general\par
|
||||
\b0\par
|
||||
AyaNova installs with the developers API so there is nothing else to download or install, however you will need to copy some files from the AyaNova program files folder to your development folder in order to keep your work separate while developing. Once you have those files copied you just need to add a reference in your project and you're ready to go.\par
|
||||
\par
|
||||
Note that when your program is ready for release you no longer need to worry about distributing or copying any of the referenced or FireBird files on the end users computer because you can simply drop your single executable in the AyaNova program file folder or plugin .dll in the AyaNova program file folder's Plugins subdirectory and all the required files will be there already.\par
|
||||
\par
|
||||
\par
|
||||
\b Getting started step by step\par
|
||||
\par
|
||||
The best way to learn how to develop for AyaNova is to examine the sample projects, we provide samples for both stand alone applications and Plugins which are copiously documented.\par
|
||||
\b0\par
|
||||
\pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-720\li720 Download and install AyaNova, take all the defaults or make note of where you install to if you are installing a second copy only for development. Run AyaNova and confirm it works.\par
|
||||
{\pntext\f1\'B7\tab}Create your initial empty project in the language and development environment of your choice\par
|
||||
{\pntext\f1\'B7\tab}Add references to the business object library by browsing to the AyaNova installation folder and selecting the 6 .dll files that make up the business object library and it's supporting components: GZTW.AyaNova.BLL.dll, GZTW.Data.dll, GZTW.Profile.dll, CSLA.dll, CSLA.Server.DataPortal.dll, CSLA.Core.Bindablebase.dll \par
|
||||
{\pntext\f1\'B7\tab}Add a reference to the .net Firebird database driver in the AyaNova installation folder: FirebirdSql.Data.FirebirdClient.dll\par
|
||||
{\pntext\f1\'B7\tab}Copy the FireBird database driver files from the AyaNova program files folder to the output folder where your program will be run from during development. (normally the /bin/Debug folder) The files are: fbembed.dll, firebird.msg, cudt30.dll, icuin30.dll and icuuc30.dll\par
|
||||
{\pntext\f1\'B7\tab}Copy the config.txt file from the AyaNova program files folder to your projects bin/debug folder so that your application will use the same database as the AyaNova you installed in the first step.\par
|
||||
{\pntext\f1\'B7\tab}Add a "Using" statement at the top of your code file to reference GZTW.AyaNova.BLL to save typing, see the samples for more details.\par
|
||||
{\pntext\f1\'B7\tab}If you are writing a stand alone application then every operation with the AyaNova business object library will require that the user login first. The examples show how to do this. You can do it automatically in code with a set login name and password or prompt for it, however you like, but you cannot use the business object library until you are authenticated.\par
|
||||
{\pntext\f1\'B7\tab}If you are writing a plugin you do not need to concern yourself with authentication.\par
|
||||
\pard\nowidctlpar\par
|
||||
\par
|
||||
\par
|
||||
\b Windows Vista / Windows 7\par
|
||||
\b0\par
|
||||
The AyaNova business object library is fully compatible with Windows Vista and Windows 7.\par
|
||||
\par
|
||||
If there is any possibility that your application you are developing will be run on Windows Vista or Windows 7 it's very important that you include or embed a manifest file with your application to ensure that UAC Virtualization does *not* take place.\par
|
||||
\par
|
||||
You can avoid a world of confusion debugging issues on Vista / 7 by using a manifest with your application and it has no effect on other older operating systems so the bottom line is just do it. :)\par
|
||||
\par
|
||||
The HelloAyaNova sample includes a manifest file with the correct settings for the Ayanova business object library which does not require elevated privileges under Vista. If your application does you will of course need to change this, however for now simply make sure you include the manifest with your executable and change the name and version tags to match your application.\par
|
||||
\par
|
||||
\par
|
||||
\par
|
||||
\b About the AyaNova business objects\par
|
||||
\par
|
||||
\b0 The AyaNova business object library is composed of 6 basic types of objects they can be recognized by their static/shared methods. The basic types are:\par
|
||||
\pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-720\li720\b Read only \b0 objects - a single object that generally is used internally by AyaNova to retrieve a count or a name or check the existance of an object\par
|
||||
\b{\pntext\f1\'B7\tab}Read only collection \b0 objects - a collection of objects generally used for list used for display or selection like a ClientPickList\par
|
||||
\b{\pntext\f1\'B7\tab}Editable Root \b0 objects - a single object that can be modified and saved. Typically these represent a real world object in AyaNova like a Client or a Workorder. \par
|
||||
\b{\pntext\f1\'B7\tab}Editable Child \b0 objects - a single object that is not directly created or deleted on it's own but exists within a collection linked to another object. For example a ClientNote is an editable child object that exists within a collection of ClientNotes which is contained within a Client editable root object.\par
|
||||
\b{\pntext\f1\'B7\tab}Editable Child Collection \b0 objects - a collection of Editable Child objects which is contained within another object. All create, delete and updates of child objects are done through this collection object.\par
|
||||
\b{\pntext\f1\'B7\tab}Editable Root Collection \b0 objects - a collection of editable child objects which stands on it's own without being contained inside another object. Typically this is objects that are almost always worked with as collections in the user interface of AyaNova rather than one by one. For example DispatchZones are an editable root collection because they are worked with in the AyaNova user interface in a list, there is no need to open a single dispatch zone to edit it because it only contains a name and an ID value so doesn't require a full screen for editing such as for more complex objects like a Client\par
|
||||
\pard\nowidctlpar\par
|
||||
\par
|
||||
\b No direct instantiation\par
|
||||
\b0\par
|
||||
Without exception every AyaNova business object is retrieved or created using a shared / static method of that object, never by direct instantiation. \par
|
||||
For example, this is always wrong with any of the AyaNova business objects:\par
|
||||
Client c=new Client(); <----WRONG!\par
|
||||
\par
|
||||
Instead use one of the static / shared methods, for example:\par
|
||||
Client c = Client.GetItem(ID); or Client c = Client.NewItem();\par
|
||||
\par
|
||||
\par
|
||||
\par
|
||||
\b Programming with each AyaNova business object type\par
|
||||
\par
|
||||
CRUD\b0\par
|
||||
All of the business objects support one or more of the following general methods: \b Create\b0 , \b Retrieve\b0 , \b Update \b0 and \b Delete\b0 .\b\par
|
||||
\par
|
||||
Read only object \par
|
||||
\pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-720\li720 Retrieve \b0 - A read only object is retrieved through it's Static / Shared GetItem(Guid ID) or similar method. Some objects have convenience overloads for GetItem or have a slightly different named get method like "GetList" or "GetListForOneItem" etc.\b\par
|
||||
\pard\nowidctlpar\par
|
||||
Read only collection object\par
|
||||
\pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-720\li720 Retrieve \b0 - There are two sub types of read only collection objects used throughout AyaNova, the ones with names that end in "List" are generally used with DataGrids in the AyaNova UI and have a \cf1 GetListByCriteria(string xmlCriteria) method where the xmlCriteria is a fragment of XML that specifies the criteria and order by specifications for the underlying query. xmlCritiera can be left empty to just get the whole list and this is generally how you would do it unless using one of the overloads for a specified list of ID's or single item.\cf0\b\par
|
||||
\cf1\b0{\pntext\f1\'B7\tab}Generally the "List" objects are not used for any purpose but display in a grid but they can be very handy for getting nicely formatted information about business objects that goes beyond what is stored inside the object itself. The second sub type of Read Only Collection objects generally end in the name "PickList" and are used to provide a working list with the name, id and active status of objects as well as selected additional fields that are specific to that object. These types of objects generally implement a shared / static GetList() method although some objects have alternative GetList type methods allowing limited filtering. \cf0\b\par
|
||||
\pard\nowidctlpar\par
|
||||
\cf1 Editable root object\par
|
||||
\pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-720\li720 Create \b0 - A new editable root object is created through it's Static / Shared NewItem() method. It is not saved to database until the Save() method is called on it. NewItem() only creates an in-memory object that doesn't physically exist or is visible to other AyaNova users until the Save() method is called. Every editable root object in AyaNova is identified by a Guid field called "ID". This value is set by the business object when it's created and can not be set or changed by the user. \cf0\b\par
|
||||
\cf1{\pntext\f1\'B7\tab}Update \b0 - Editable root objects have various properties defined that can be set. Each property may have one or more business rules that will be enforced when the property is set. For example a Unit object requires a serial number. If you try to save it without setting the serial number it will fail. You can always see if an object can be saved by checking the IsSavable property and you can tell what rules are broken by checking the contents of the BrokenRulesText property. \ul\b VERY IMPORTANT: The Save() method returns a fresh copy of the object after saving. If you intend to keep using the object after saving it then you must set your variable for that object to the object returned by Save(). \ulnone\b0 I.E. Unit u=Unit.NewItem(); u.Serial="abc"; u=(Unit)u.Save(); Notice that the Save() method object returned is a generic one and needs to be cast to the type of object in question. AyaNova uses a concurrency system that favors the first person to save a duplicate object. When two people at different computers open the same object and both modify it and save it, the person that saved first "wins" and the second user's object will return an exception indicating that the object was already changed by another user including the user's name. Your app should handle that situation.\cf0\b\par
|
||||
\cf1{\pntext\f1\'B7\tab}Retrieve \b0 - Editable Root Objects are retrieved by the Shared / Static method GetItem(Guid ID); In some rare cases there may be other GetXX methods implemented where it makes sense to do so.\cf0\b\par
|
||||
\cf1{\pntext\f1\'B7\tab}Delete \b0 - Editable Root Objects can be deleted in two ways: By marking an instantiated object as Deleted by calling it's base Delete method (not recommended, may be deprecated in future, AyaNova does not use this method itself), or by calling the Shared / Static Delete(Guid ID) method (use this one). \cf0\b\par
|
||||
\cf1\b0{\pntext\f1\'B7\tab}A delete is not guaranteed for any object and this should be anticipated. For example a closed work order can not be deleted, the one and only Global object can not be deleted and in the case of an object that has relationships active in the database with other objects a delete will throw a database exception regarding referential integrity. For example if a client is used on any workorders it can not be deleted until those workorders are removed or the client changed. This is common for pretty much every editable root object and your application should handle this situation.\cf0\b\par
|
||||
\pard\nowidctlpar\par
|
||||
\cf1 Editable child object\b0\par
|
||||
\pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-720\li720\cf0\b Create \b0 - Editable child objects that are part of a collection are created through their parent collections Add method. For example a Rate object is not created directly but created by calling the Add() method on the parent Rates collection which in turn is generally a field in another object. In some cases editable child objects are not part of a collection but are a single object contained in a field within a parent object. In those cases the child is created by default by the parent object and does not need to be created by the developer as it already exists. A good example of this is an Address in a Client object. You don't need to create one, it's always there and created by the Client when it is in turn created.\b\par
|
||||
{\pntext\f1\'B7\tab}Update \b0 - Editable child objects are updated by retrieving them via an indexer for their collection or a property on their parent object that represents them. For example a service rate in a contract's rates collection is retrieved by ID by the indexer in Rates contract.Rates[ID]. Various indexers are implemented for all collections including a simple index by position. Editable child objects are saved via their parent object or collection object they reside in. Generally speaking you only save the highest parent object in the hiearchy, never a child collection directly. So for example a Contract object has a child Rates collection which in turn has individual service rates for that contract. You would only ever save the Contract which in turn will save the child collection which will in turn save the Child rate objects automatically.\b\par
|
||||
{\pntext\f1\'B7\tab}Retrieve \b0 - An editable child is retrieved by retrieving it's parent object. In the Contract example previously, you don't retrieve an individual rate, you retrieve the contract which in turn retrieves the Rates collection which in turn retrieves the individual rates. \b\par
|
||||
{\pntext\f1\'B7\tab}Delete \b0 - An editable child is deleted by removing it from the collection it is contained in by calling the collection's Remove method and then saving the collection via it's parent to make the change in the actual database. A deleted child object in a collection is not physically deleted from the database until it's parent collection is saved. A child object that exists in a one to one relationship with another object (i.e. is not part of a collection) can not be deleted unless the entire parent object is deleted.\b\par
|
||||
\pard\nowidctlpar\par
|
||||
Editable child collection object\par
|
||||
\pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-720\li720\b0 All methods for these objects are pretty much covered in the Editable child subject above. It's important to note that these objects are always a field within a parent object.\b\par
|
||||
\pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlcont\pnf1\pnindent0{\pntxtb\'B7}}\nowidctlpar\par
|
||||
{\pntext\f1\'B7\tab}Editable Root Collection object\par
|
||||
\pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-720\li720 Create \b0 - There is no need to ever create an entire editable root collection, it is always present and is worked with by retrieving the one and only editable root collecton.\b\par
|
||||
{\pntext\f1\'B7\tab}Update \b0 - Editable root collections are not directly edited, they are a container to hold editable child objects which are edited via the root collection indirectly.\b\par
|
||||
{\pntext\f1\'B7\tab}Retrieve \b0 - Editable root collections are retrieved via their Shared / Static GetItems() method and various alternatives. It should be noted that even if you know you have no items of a particular type present in the database, let's say PartWarehouses as an example, you would still call the GetItems() method before you can add a PartWarehouse to it's collection.\b\par
|
||||
{\pntext\f1\'B7\tab}Delete \b0 - An editable root collection is never deleted wholesale, it's child items that it contains can be deleted by calling the collection object's Remove method for individual child items\b\par
|
||||
\pard\nowidctlpar\par
|
||||
\par
|
||||
Sample projects\b0\par
|
||||
\par
|
||||
The sample projects were created in Microsoft Visual Studio 2008. \par
|
||||
\par
|
||||
\par
|
||||
\b Exceptions\par
|
||||
\par
|
||||
\b0 If your application should receive an exception error while using the AyaNova business objects please note that more often than not the exception you will receive is a TargetInvocation exception. \par
|
||||
\par
|
||||
To get the actual exception you need to use the InnerException property of the initial exception. This is because the AyaNova objects are invoked indirectly by a factory method and it wraps the original exception in a TargetInvocation Exception.\par
|
||||
\par
|
||||
Your debugger output window will most likely show the entire exception, but if you want to report it to a user, make sure you \ldblquote crack\rdblquote the exception returned by looping through it and getting every inner exception within each exception level by level. The HelloAyaNova example shows how to do this.\par
|
||||
It\rquote s possible that the first level will be relevant, more likely the second level is more relevant and in some cases such as a database generated exception they will be in a third level deep.\par
|
||||
\par
|
||||
If you see a TargetInvocation exception it is generally meaningless and won\rquote t help you diagnose the problem, you need the inner exception to get the real error.\par
|
||||
\par
|
||||
\b Questions\par
|
||||
\b0\par
|
||||
Please do not hesitate to post your questions on the AyaNova developer support forum at forum.ayanova.com This forum is monitored by our developers and questions will often be answered the same day. Remember we support the AyaNova api only, we can not write your program for you or provide help with 3rd party tools etc where other means of support exist.\par
|
||||
\par
|
||||
\par
|
||||
}
|
||||
| ||||