Initial Commit

This commit is contained in:
2016-07-27 00:32:34 -04:00
commit 8d162b2035
701 changed files with 188672 additions and 0 deletions

View File

@@ -0,0 +1,237 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Pluto.Api;
namespace Pluto.MSL.Api
{
public class API
{
#region Construction
private static HiddenMainForm _hiddenFrm = null;
static API()
{
_hiddenFrm = new HiddenMainForm();
_hiddenFrm.Opacity = 0;
_hiddenFrm.Show();
_hiddenFrm.Visible = false;
}
#endregion
#region Change Network Settings
/// <summary>
/// Use this function to change the URL and port for the client to use when
/// communicating (affects entire API)
/// </summary>
/// <param name="url"></param>
/// <param name="port"></param>
public static void SetNetworkSettings(string url, uint port)
{
bool bChangeOccured = false;
if (!String.IsNullOrEmpty(url) && String.Compare(_hiddenFrm.ClientChannel.Hostname, url, true) != 0)
{
bChangeOccured = true;
_hiddenFrm.ClientChannel.Hostname = url;
}
if (port > 0 && _hiddenFrm.ClientChannel.Port != (int)port)
{
bChangeOccured = true;
_hiddenFrm.ClientChannel.Port = (int)port;
}
if (bChangeOccured)
{
_hiddenFrm.ClientChannel.TargetUrl = String.Format("tcp://{0}:{1}/bin", _hiddenFrm.ClientChannel.Hostname, _hiddenFrm.ClientChannel.Port);
}
}
#endregion
#region IMSLMobileConnect
/// <summary>
/// Called by Lytec/Medisoft when the mobile About Dialog is called to retrieve the UserApiKey and Pin
/// </summary>
/// <param name="SharedConnectionDataSource"></param>
/// <param name="PracticeName"></param>
/// <param name="UserApiKey"></param>
/// <param name="UserPin"></param>
/// <returns></returns>
public static bool MobileAboutDialog_GotCalled(string SharedConnectionDataSource, string RegisteredName, string PracticeName, string DataBaseNameOrDataSetName, out string UserApiKey, out string UserPin)
{
UserApiKey = String.Empty;
UserPin = String.Empty;
if (!String.IsNullOrEmpty(SharedConnectionDataSource) && !String.IsNullOrEmpty(PracticeName))
{
ApiKeyNPin key = _hiddenFrm.fMSLSpecific.MobileAboutDialogCalled(SharedConnectionDataSource, RegisteredName, PracticeName, DataBaseNameOrDataSetName);
if (key == null)
return false;
UserApiKey = key.UserApiKey;
UserPin = key.UserPin;
return true;
}
return false;
}
/// <summary>
/// Called by Lytec/Medisoft once product setup is complete (product is registered and
/// connected to a database), but before the user logs in. This will setup the Mobile service
/// on the server.
/// </summary>
/// <param name="string SharedConnectionDataSource"></param>
/// <returns></returns>
public static bool ProductSetupCompleted_PriorUserLogin(string SharedConnectionDataSource, string RegisteredName)
{
if (!String.IsNullOrEmpty(SharedConnectionDataSource))
{
bool bResult = _hiddenFrm.fMSLSpecific.ProductSetupCompleted(SharedConnectionDataSource, RegisteredName);
return bResult;
}
return false;
}
/// <summary>
/// Called by Lytec/Medisoft after a Practice Name Change occurred on their end to let
/// the Mobile solution know and update it's information
/// </summary>
/// <param name="SharedConnectionDataSource"></param>
/// <param name="NewPracticeName"></param>
/// <returns></returns>
public static bool PracticeName_ChangeOccured(string SharedConnectionDataSource, string NewPracticeName, string DataBaseNameOrDataSetName)
{
if (!String.IsNullOrEmpty(SharedConnectionDataSource) && !String.IsNullOrEmpty(NewPracticeName))
{
bool bResult = _hiddenFrm.fMSLSpecific.PracticeNameChangeOccured(SharedConnectionDataSource, NewPracticeName, DataBaseNameOrDataSetName);
return bResult;
}
return false;
}
/// <summary>
/// Is the Server Reachable from the internet? if not, show error icon or give message
/// </summary>
/// <param name="SharedConnectionDataSource"></param>
/// <returns></returns>
public static bool IsServerReachableFromTheInternet(string SharedConnectionDataSource)
{
if (!String.IsNullOrEmpty(SharedConnectionDataSource))
{
bool bResult = _hiddenFrm.fMSLSpecific.IsServerReachableFromTheInternet(SharedConnectionDataSource);
return bResult;
}
return false;
}
#endregion
#region Pluto AddOns
/// <summary>
/// Try to update the Service, if needed
/// </summary>
public static void UpdateServiceIfNeeded()
{
_hiddenFrm.fMSLSpecific.UpdateServiceIfNeeded();
}
/// <summary>
/// Check if service isd out of date
/// </summary>
/// <returns></returns>
public static bool IsAPIOutOfDate()
{
return _hiddenFrm.fAuthentication.IsAPIOutOfDate();
}
/// <summary>
/// Retrieve the API version of the service
/// </summary>
/// <returns></returns>
public static string GetAPIVersion()
{
return _hiddenFrm.fAuthentication.GetAPIVersion();
}
/// <summary>
/// Retrieve the Pluto Service's HOST GUID
/// </summary>
/// <returns></returns>
public static string GetHostGUID()
{
return _hiddenFrm.fMSLSpecific.GetHostSpecGUID();
}
/// <summary>
/// Retrieve Pluto Service's External Port
/// </summary>
/// <returns></returns>
public static int GetExternalPort()
{
return _hiddenFrm.fMSLSpecific.GetExternalPort();
}
/// <summary>
/// Retrieve Pluto Service's External IP
/// </summary>
/// <returns></returns>
public static string GetExternalIP()
{
return _hiddenFrm.fMSLSpecific.GetExternalIP();
}
/// <summary>
/// Retrieve Pluto Service's Local IP
/// </summary>
/// <returns></returns>
public static string GetLocalIP()
{
return _hiddenFrm.fMSLSpecific.GetLocalIP();
}
/// <summary>
/// Generate all user api keys for all connections
/// </summary>
public static void GenerateApiKeysForPracticesInLoadedSharedCredentials()
{
_hiddenFrm.fMSLSpecific.GenerateApiKeysForPracticesInLoadedSharedCredentials();
}
/// <summary>
/// Add a Shared Credential to the Store
/// </summary>
/// <param name="credential"></param>
/// <returns></returns>
public static bool AddSharedCredential(ApiKeyNCredential credential)
{
return _hiddenFrm.fMSLSpecific.AddSharedCredential(credential);
}
/// <summary>
/// Rerieve all loaded Credentials
/// </summary>
/// <returns></returns>
public static ApiKeyNCredential[] GetLoadedCredentials()
{
return _hiddenFrm.fMSLSpecific.GetLoadedCredentials();
}
#endregion
#region Pluto
/// <summary>
/// Post Billing
/// </summary>
public static bool PostBilling(string SystemApiKey, BillingPost1 billingPost)
{
return _hiddenFrm.fBilling.PostBilling(SystemApiKey, String.Empty, billingPost);
}
#endregion
}
}

View File

@@ -0,0 +1,79 @@
namespace Pluto.MSL.Api
{
partial class HiddenMainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (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.ClientChannel = new RemObjects.SDK.IpTcpClientChannel();
this.binMessage = new RemObjects.SDK.BinMessage();
this.aesEncryptionEnvelope = new RemObjects.SDK.AesEncryptionEnvelope();
this.SuspendLayout();
//
// ClientChannel
//
this.ClientChannel.Hostname = "127.0.0.1";
this.ClientChannel.Port = 1945;
this.ClientChannel.TargetUrl = "tcp://127.0.0.1:1945/bin";
//
// binMessage
//
this.binMessage.ContentType = "application/octet-stream";
this.binMessage.Envelopes.Add(new RemObjects.SDK.MessageEnvelopeItem(this.aesEncryptionEnvelope));
this.binMessage.SerializerInstance = null;
//
// aesEncryptionEnvelope
//
this.aesEncryptionEnvelope.EnvelopeMarker = "AES";
this.aesEncryptionEnvelope.Password = "KxHWkkE5PAp4tuTzmPKQF7RUyylMk7VOV8zfYln2w6NZJMOvT3yrXofIJWxJYRSQwAkm8DysTG9k7";
//
// HiddenMainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(124, 11);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "HiddenMainForm";
this.Opacity = 0D;
this.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Hidden";
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
this.Load += new System.EventHandler(this.HiddenMainForm_Load);
this.ResumeLayout(false);
}
#endregion
internal RemObjects.SDK.IpTcpClientChannel ClientChannel;
private RemObjects.SDK.BinMessage binMessage;
private RemObjects.SDK.AesEncryptionEnvelope aesEncryptionEnvelope;
}
}

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pluto.Api;
namespace Pluto.MSL.Api
{
public partial class HiddenMainForm : Form
{
/// <summary>
/// Expose the Pluto Object for the API
/// </summary>
internal IMSLSpecific fMSLSpecific = null;
internal IAuthentication fAuthentication = null;
internal IBilling fBilling = null;
public HiddenMainForm()
{
InitializeComponent();
}
private void HiddenMainForm_Load(object sender, EventArgs e)
{
fMSLSpecific = CoMSLSpecific.Create(binMessage, ClientChannel);
fAuthentication = CoAuthentication.Create(binMessage, ClientChannel);
fBilling = CoBilling.Create(binMessage, ClientChannel);
MSLSpecific_AsyncProxy dd = new MSLSpecific_AsyncProxy(binMessage, ClientChannel);
//dd.BeginGetExternalPort(
//Co
}
}
}

View File

@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
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">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</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 for serialized 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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ClientChannel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>126, 17</value>
</metadata>
<metadata name="binMessage.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="aesEncryptionEnvelope.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>245, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B794609D-A93E-41E3-9291-84FC73412347}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Pluto.MSL.Api</RootNamespace>
<AssemblyName>Pluto.MSL.Api</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Target\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Target\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="RemObjects.InternetPack, Version=7.0.63.1055, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098, processorArchitecture=MSIL">
<Private>True</Private>
</Reference>
<Reference Include="RemObjects.SDK, Version=7.0.63.1055, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098, processorArchitecture=MSIL">
<Private>True</Private>
</Reference>
<Reference Include="RemObjects.SDK.ZLib, Version=7.0.63.1055, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098, processorArchitecture=MSIL">
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\PlutoServer\PlutoApi_Intf.cs">
<Link>PlutoApi_Intf.cs</Link>
</Compile>
<Compile Include="API.cs" />
<Compile Include="HiddenMainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="HiddenMainForm.Designer.cs">
<DependentUpon>HiddenMainForm.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="HiddenMainForm.resx">
<DependentUpon>HiddenMainForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 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("Pluto.MSL.Api")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Pluto.MSL.Api")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a25147cc-4d5b-4df5-85b8-d6257afd1f72")]
// 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 Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]