This commit is contained in:
@@ -0,0 +1,126 @@
|
||||
<?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>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4BA96211-2586-4D86-BDA0-F6E6046AA0A6}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AyaNova.Plugin.RepairTekCPC</RootNamespace>
|
||||
<AssemblyName>AyaNova.Plugin.RepairTekCPC</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\WinFormApp\bin\debug\plugins\RepairTekCPC\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\..\Installs\RepairTekCPC\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Infragistics4.Documents.Excel.v11.2, Version=11.2.20112.2135, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>C:\Program Files\Infragistics\NetAdvantage 2011.2\Windows Forms\CLR4.0\Bin\Infragistics4.Documents.Excel.v11.2.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Infragistics4.Documents.Core.v11.2, Version=11.2.20112.2135, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>C:\Program Files\Infragistics\NetAdvantage 2011.2\Windows Forms\CLR4.0\Bin\Infragistics4.Documents.Core.v11.2.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CopyableMessageBox.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RepairTek.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\AyaNova.PlugIn\AyaNova.PlugIn.csproj">
|
||||
<Project>{674BC3C9-4F74-4304-91ED-2EAFFFEB09A7}</Project>
|
||||
<Name>AyaNova.PlugIn</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\bizobjects\AyaLib\GZTW.AyaNova.BLL.csproj">
|
||||
<Project>{50B807B6-FC35-4CC3-B54D-91C78426A943}</Project>
|
||||
<Name>GZTW.AyaNova.BLL</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\csla10\CSLA.Core.Bindablebase\CSLA.Core.Bindablebase.csproj">
|
||||
<Project>{C2392355-12A9-4197-A1D3-603C390B1E62}</Project>
|
||||
<Name>CSLA.Core.Bindablebase</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\csla10\CSLA.Server.DataPortal\CSLA.Server.DataPortal.vbproj">
|
||||
<Project>{80828E2C-E9FB-4E73-A27C-7F9CDB96FCDE}</Project>
|
||||
<Name>CSLA.Server.DataPortal</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\csla10\CSLA\CSLA.vbproj">
|
||||
<Project>{1B9A38BB-461A-47A4-AD72-099C694138A0}</Project>
|
||||
<Name>CSLA</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Data\Data\GZTW.Data.csproj">
|
||||
<Project>{701893AA-C042-4FB2-8643-E139372C1117}</Project>
|
||||
<Name>GZTW.Data</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Profile\GZTW.Profile\GZTW.Profile.csproj">
|
||||
<Project>{EDE897E2-E2E6-441D-9F83-0B973AE09670}</Project>
|
||||
<Name>GZTW.Profile</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="CopyableMessageBox.resx">
|
||||
<DependentUpon>CopyableMessageBox.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</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>
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AyaNova.Plugin.RepairTekCPC
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for CopyableMessageBox.
|
||||
/// </summary>
|
||||
public class CopyableMessageBox : System.Windows.Forms.Form
|
||||
{
|
||||
private System.Windows.Forms.TextBox edOut;
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.Container components = null;
|
||||
private string mDisplay="";
|
||||
public CopyableMessageBox(string Display)
|
||||
{
|
||||
//
|
||||
// Required for Windows Form Designer support
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
mDisplay=Display;
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
}
|
||||
|
||||
/// <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()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CopyableMessageBox));
|
||||
this.edOut = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// edOut
|
||||
//
|
||||
this.edOut.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.edOut.Location = new System.Drawing.Point(0, 0);
|
||||
this.edOut.Multiline = true;
|
||||
this.edOut.Name = "edOut";
|
||||
this.edOut.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.edOut.Size = new System.Drawing.Size(769, 453);
|
||||
this.edOut.TabIndex = 0;
|
||||
//
|
||||
// CopyableMessageBox
|
||||
//
|
||||
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
|
||||
this.ClientSize = new System.Drawing.Size(769, 453);
|
||||
this.Controls.Add(this.edOut);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "CopyableMessageBox";
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "Results";
|
||||
this.Load += new System.EventHandler(this.CopyableMessageBox_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void CopyableMessageBox_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
edOut.Text=mDisplay;
|
||||
}
|
||||
}
|
||||
}
|
||||
197
source/Plugins/AyaNova.Plugin.RepairTek2/CopyableMessageBox.resx
Normal file
197
source/Plugins/AyaNova.Plugin.RepairTek2/CopyableMessageBox.resx
Normal file
@@ -0,0 +1,197 @@
|
||||
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAgBAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAA//////////////+f///8D///4AP//4AB//+AAP//gAD//4AA//+AAP/8
|
||||
AAD8EAAD4AA4HwAA/f8AA///AAH//wAB//8AAf//gAB/v8AADB/gHgAH8P8AA///AAH//wAB//8AAf//
|
||||
AAH//4AB///AA///8B////n///////////8=
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -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("AyaNova.Plugin.RepairTekCPC")]
|
||||
[assembly: AssemblyDescription("RepairTek - Project CPC plugin for AyaNova")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ground Zero Tech-Works Inc.")]
|
||||
[assembly: AssemblyProduct("AyaNova.Plugin.RepairTekCPC")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2009-2017 Ground Zero Tech-Works Inc.")]
|
||||
[assembly: AssemblyTrademark("AyaNova is a registered trademark of Ground Zero Tech-Works Inc.")]
|
||||
[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("DFEF7561-489E-43BE-8252-E39A4797422F")]
|
||||
|
||||
// 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("7.2.1.0")]
|
||||
[assembly: AssemblyFileVersion("7.2.1.0")]
|
||||
568
source/Plugins/AyaNova.Plugin.RepairTek2/RepairTek.cs
Normal file
568
source/Plugins/AyaNova.Plugin.RepairTek2/RepairTek.cs
Normal file
@@ -0,0 +1,568 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AyaNova.PlugIn;
|
||||
using GZTW.AyaNova.BLL;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Reflection;
|
||||
using System.Data;
|
||||
|
||||
using Infragistics.Documents.Excel;
|
||||
|
||||
namespace AyaNova.Plugin.RepairTekCPC
|
||||
{
|
||||
class RepairTek : IAyaNovaPlugin
|
||||
{
|
||||
//Keep all the object types we want to deal with in a collection
|
||||
//so that we can quickly check it when asked
|
||||
private static List<RootObjectTypes> ObjectsWeCanDealWith = null;
|
||||
//Holds the image resources from AyaNova
|
||||
//so we can display the correct icons in our plugin
|
||||
System.Resources.ResourceManager resman = null;
|
||||
|
||||
//Holds the current logged in user's localized text
|
||||
//lookup object
|
||||
LocalizedTextTable LocaleText = null;
|
||||
|
||||
#region IAyaNovaPlugin Members
|
||||
|
||||
#region interface properties
|
||||
public string PluginName
|
||||
{
|
||||
get { return "RepairTek - Project CPC"; }
|
||||
}
|
||||
|
||||
public string PluginVersion
|
||||
{
|
||||
get { return "7.2"; }
|
||||
}
|
||||
|
||||
public string About
|
||||
{
|
||||
get
|
||||
{
|
||||
return "AyaNova RepairTek - Project CPC plugin\r\n" +
|
||||
"Copyright 2009-2017 Ground Zero Tech-Works Inc.";
|
||||
}
|
||||
}
|
||||
|
||||
public Guid PluginID
|
||||
{
|
||||
get { return new Guid("{DFEF7561-489E-43BE-8252-E39A4797422F}"); }
|
||||
}
|
||||
|
||||
public System.Drawing.Image PluginSmallIcon
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public System.Drawing.Image PluginLargeIcon
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public System.Resources.ResourceManager AyaNovaResourceManager
|
||||
{
|
||||
set { resman = value; }
|
||||
get { return resman; }
|
||||
}
|
||||
#endregion interface properties
|
||||
|
||||
#region Initialization and Close
|
||||
public bool Initialize(Version AyaNovaVersion, LocalizedTextTable localizedText)
|
||||
{
|
||||
LocaleText = localizedText;
|
||||
ObjectsWeCanDealWith = new List<RootObjectTypes>();
|
||||
ObjectsWeCanDealWith.Add(RootObjectTypes.Nothing);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
;
|
||||
}
|
||||
#endregion Initialization and close
|
||||
|
||||
#region ShowMenu?
|
||||
public bool SingleObjectMenuShow(RootObjectTypes objectType)
|
||||
{
|
||||
return (ObjectsWeCanDealWith.Contains(objectType));
|
||||
}
|
||||
|
||||
public bool MultipleObjectsMenuShow(RootObjectTypes objectType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion show menu?
|
||||
|
||||
#region Menu options
|
||||
public List<AyaNovaPluginMenuItem> SingleObjectMenuOptions(RootObjectTypes objectType, object ayaNovaObject)
|
||||
{
|
||||
|
||||
|
||||
if (!ObjectsWeCanDealWith.Contains(objectType)) return null;
|
||||
List<AyaNovaPluginMenuItem> list = new List<AyaNovaPluginMenuItem>();
|
||||
list.Add(new AyaNovaPluginMenuItem("REPAIRTEKCPC", "RepairTek - Project CPC", null, null));
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<AyaNovaPluginMenuItem> MultipleObjectsMenuOptions(RootObjectTypes objectType)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Menu Commands
|
||||
|
||||
#region LIST OBJECT COMMAND
|
||||
/// <summary>
|
||||
/// LIST OBJECT
|
||||
/// </summary>
|
||||
/// <param name="commandKey"></param>
|
||||
/// <param name="objectType"></param>
|
||||
/// <param name="objectIDList"></param>
|
||||
/// <param name="listObject"></param>
|
||||
/// <returns></returns>
|
||||
public bool CommandSelectedForList(string commandKey, RootObjectTypes objectType, List<Guid> objectIDList, object listObject)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion list object command
|
||||
|
||||
#region SINGLE OBJECT COMMAND
|
||||
/// <summary>
|
||||
/// SINGLE OBJECT
|
||||
/// </summary>
|
||||
/// <param name="commandKey"></param>
|
||||
/// <param name="objectType"></param>
|
||||
/// <param name="ayaNovaObject"></param>
|
||||
public void CommandSelectedForSingleObject(string commandKey, RootObjectTypes objectType, object ayaNovaObject)
|
||||
{
|
||||
|
||||
switch (commandKey)
|
||||
{
|
||||
|
||||
case "REPAIRTEKCPC":
|
||||
{
|
||||
Update();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
#endregion single object command
|
||||
|
||||
#endregion menu commands
|
||||
|
||||
#endregion
|
||||
|
||||
/*
|
||||
THIS IS THE "REPAIRTEK CPC" PLUGIN - REPAIRTEK2
|
||||
|
||||
*/
|
||||
|
||||
#region REPAIRTEKCPC Update workorders from spreadsheet
|
||||
#region specifications
|
||||
/*
|
||||
*
|
||||
* Specifics of plugin needed:
|
||||
|
||||
First row of the xlxs file being imported will always just be headers. Include code to not import first row.
|
||||
|
||||
I have identified specifics below on what to be done if existing data is already in a particular field (because he may import the same file a few times, so I have confirmed specifics with him for what situations for what fields)
|
||||
|
||||
xlxs file will always be in the format as per the sample (i.e. first column will always be WO#, 6th column will always be the TICKET # field which equates to the Workorder.Label.CustomerReferenceNumber, etc)
|
||||
|
||||
First column WO# will equate to an existing workorder number in the database being imported into.
|
||||
|
||||
If the import file has a workorder number that is not in the database, to display at the end of the import process a list of any workorder #'s in the xlxs file that are NOT in the database.
|
||||
|
||||
|
||||
6th column field in the xlxs file is identified as the TICKET # field
|
||||
|
||||
TICKET # field equates to the Workorder.Label.CustomerReferenceNumber which is the default localized Client Reference #: field in the service workorder header area.
|
||||
It is understood that text longer than 254 will be truncated.
|
||||
If there is no data in the TICKET # field in the import file, the import to continue importing this xlxs row's other fields
|
||||
If there is data already in the TICKET # field in the database, NOT to overwrite this data in this field.
|
||||
**IMPORTANT**AND If there is data already in the TICKET # field in the database before updating the workorder, to identify at the end of the import IF the data in the TICKET # field in the import file matches the already entered data in the TICKET # field of the actual workorder.
|
||||
(suggestion would be to identify the WO# and could be as simple as WO#xxxxx data in TICKET# fields do not match import file
|
||||
|
||||
|
||||
7th column field in the xlxs file is identified as the NOTIFICATION field
|
||||
|
||||
NOTIFICATION field equates to the Workorder.Label.CustomerContactName which is the default localized Contact: field in the service workorder header area.
|
||||
It is understood that text longer than 254 will be truncated
|
||||
If there is no data in the NOTIFICATION field in the import file, the import to continue importing this xlxs row's other fields
|
||||
If there is data already in the NOTIFICATION field in the workorder, DO overwrite the data
|
||||
|
||||
|
||||
8th column field in the xlxs file is identified as the PROBLEM DESCRIPTI field
|
||||
|
||||
PROBLEM DESCRIPTI field equates to the O.Project which is the default localized Project: field in the service workorder header area
|
||||
**This is a selection field
|
||||
Refer to the provided database for ID numbers of the already set up PROBLEM DESCRIPTI (or if its easier for you, than just go by the Name)
|
||||
If there is no data in the PROBLEM DESCRIPTI field in the import file, the import to continue importing this xlxs row's other fields
|
||||
If there is data already in the PROBLEM DESCRIPTI field in the workorder, DO overwrite the data
|
||||
**IMPORTANT** If there is NOT an existing PROBLEM DESCRIPTI with the same ID or Name in the AyaNova database, to identify at the end of the import that this WO# in the import file has a PROBLEM DESCRIPTI not coded for (or however you want to language it, but in layman's terms letting him know what WO# needed attention because of a PROBLEM DESCRIPTI issue)
|
||||
|
||||
|
||||
|
||||
9th column field in your xlxs file xlxs file is identified as the CANADA POST WC field
|
||||
|
||||
CANADA POST WC field equates to the Workorder.Label.Summary which is the default localized Summary: field in the service workorder header area.
|
||||
It is understood that text longer than 254 will be truncated
|
||||
If there is no data in the CANADA POST WC field in the import file, the import to continue importing this xlxs row's other fields
|
||||
Data could be alpha and/or numbers, enter exactly as displayed in the import file (i.e. if it starts with a 0 make sure it enters the full number including starting with a 0) I don't see a problem with this, as the field is a text field, but he made a point of bringing this up so I wanted to pass on.
|
||||
If there is data already in the CANADA POST WC field in the workorder, DO overwrite the data
|
||||
|
||||
|
||||
10th column field in the xlxs file is identified as the INBOUND TRACKING # field
|
||||
|
||||
INBOUND TRACKING # field equates to the WorkorderItem.Label.Summary which is the default localized Workorder Item Summary: field in the service workorder ITEM area.
|
||||
It is understood that text longer than 254 will be truncated
|
||||
If there is no data in the INBOUND TRACKING # field in the import file, the import to continue importing this xlxs row's other fields
|
||||
If there is data already in the INBOUND TRACKING # field in the workorder, DO overwrite the data
|
||||
|
||||
|
||||
11th column field in the xlxs file is identified as the DATA field (in the actual database, this is further as DATA TRAPPED REQUEST)
|
||||
|
||||
DATA field equates to the WorkorderItem.Label.PriorityID and O.Priority which is the default localized Priority : field in the workorder item area
|
||||
**This is a selection field
|
||||
If there is no data in the DATA field in the import file, the import to continue importing this xlxs row's other fields
|
||||
If there is data already in the DATA field in the workorder, DO overwrite the data
|
||||
If there is NOT an existing DATA with the same ID or Name in the AyaNova database, to identify at the end of the import that this WO# in the import file has a DATA not coded for (or however you want to language it, but in layman's terms letting him know what WO# needed attention because of a DATA issue)
|
||||
|
||||
|
||||
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* UPDATE: 5/21/2014:
|
||||
12th column field:
|
||||
|
||||
"...and now Frank would like you to customize the existing CPC adding the following:
|
||||
|
||||
customize the existing CPC plugin so that whatever text is in the CONTACT field of the row (column 12 of the row as shown in the example xlsx that is attached)
|
||||
* is copied into the Travel Details field (Key: WorkorderItemTravel.Label.TravelDetails) of that service workorder.
|
||||
There will only ever be one Travel record in the service workorder
|
||||
If there is NOT a Travel record, Frank would like the display at the end when the plugin is done running, to identify which
|
||||
workorders did not have a Travel record (so that he can then create the travel record, and run the CPC again to have the text filled in using that plugin"
|
||||
|
||||
*
|
||||
* UPDATE: 5/27/2014 Frank wants it to create a travel if none, not just report it as an error.
|
||||
|
||||
*
|
||||
*
|
||||
*
|
||||
* */
|
||||
#endregion specifications
|
||||
|
||||
/// <summary>
|
||||
/// Update workorders
|
||||
/// </summary>
|
||||
private void Update()
|
||||
{
|
||||
//track ops to report upon completion
|
||||
System.Text.StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("Import results:");
|
||||
|
||||
#region Open the xls file
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
ofd.Multiselect = false;
|
||||
ofd.Title = "";
|
||||
ofd.DefaultExt = "xlsx";
|
||||
ofd.FileName = "*.xlsx";
|
||||
if (ofd.ShowDialog() != DialogResult.OK) return;
|
||||
Workbook workbook;
|
||||
try
|
||||
{
|
||||
workbook = Workbook.Load(ofd.FileName);
|
||||
sb.AppendLine("File " + ofd.FileName + " opened for processing...");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error opening file:\r\n" + ex.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
ofd.Dispose();
|
||||
#endregion open the xls
|
||||
|
||||
//Projects list
|
||||
ProjectList projects = ProjectList.GetList("");
|
||||
|
||||
//fetch priority list
|
||||
PriorityPickList priorities = PriorityPickList.GetList();
|
||||
|
||||
//Iterate the workorders
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
|
||||
int nRow = 0;
|
||||
foreach (WorksheetRow r in workbook.Worksheets[0].Rows)
|
||||
{
|
||||
bool bWasError = false;//used for cleaner reporting at end
|
||||
|
||||
nRow++;
|
||||
Workorder w;
|
||||
string sWorkorderNumber = SafeGetCellValue(r, 0);
|
||||
|
||||
#region fetch workorder
|
||||
//skip over empty rows
|
||||
if (string.IsNullOrEmpty(sWorkorderNumber))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tskipped - empty row");
|
||||
continue;
|
||||
}
|
||||
|
||||
//skip over the title row
|
||||
if(sWorkorderNumber.StartsWith("W"))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tlooks like headers, skipping");
|
||||
continue;
|
||||
}
|
||||
|
||||
int nWo = 0;
|
||||
if (!System.Int32.TryParse(sWorkorderNumber, out nWo))
|
||||
{
|
||||
sb.AppendLine("ERROR:\t[Row " + nRow.ToString() + "]\ta valid workorder number was not found in import value \"" + sWorkorderNumber + "\". Skipping this row");
|
||||
continue;
|
||||
}
|
||||
Guid woID = WorkorderInternalIDFetcher.GetItem(nWo.ToString(), WorkorderTypes.Service);
|
||||
if (woID == Guid.Empty)
|
||||
{
|
||||
sb.AppendLine("ERROR:\t[Row " + nRow.ToString() + "]\tworkorder \"" + sWorkorderNumber + "\" not found in AyaNova. Skipping this row");
|
||||
continue;
|
||||
}
|
||||
w = Workorder.GetItem(woID);
|
||||
|
||||
if (!w.IsEditable)
|
||||
{
|
||||
sb.AppendLine("WARN:\t[Row " + nRow.ToString() + "]\tworkorder \"" + sWorkorderNumber + "\" is not editable. Is it Closed or user has insufficient rights? Skipping this row");
|
||||
continue;
|
||||
}
|
||||
#endregion get workorder
|
||||
|
||||
#region Set values from spreadsheet row
|
||||
|
||||
//6th column TICKET # (Workorder.Label.CustomerReferenceNumber)
|
||||
string sTicketNumber = SafeGetCellValue254(r, 5);
|
||||
if (!string.IsNullOrWhiteSpace(sTicketNumber))
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(w.CustomerReferenceNumber))
|
||||
{
|
||||
//easiest case, just import and move on
|
||||
w.CustomerReferenceNumber = sTicketNumber;
|
||||
}
|
||||
else
|
||||
{
|
||||
//if they differ then log it
|
||||
if (w.CustomerReferenceNumber != sTicketNumber)
|
||||
{
|
||||
sb.AppendLine("WARN:\t[Row " + nRow.ToString() + "]\tworkorder \"" + sWorkorderNumber + "\" pre-existing data in workorder TICKET# field (\""+w.CustomerReferenceNumber+"\") does not match import file value (\""+ sTicketNumber + "\")");
|
||||
bWasError = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//7th column NOTIFICATION field (Workorder.Label.CustomerContactName)
|
||||
string sNotification = SafeGetCellValue254(r, 6);
|
||||
if (!string.IsNullOrWhiteSpace(sNotification))
|
||||
{
|
||||
//"If there is data already in the NOTIFICATION field in the workorder, DO overwrite the data"
|
||||
//so just set it no matter what if it's not empty
|
||||
w.CustomerContactName = sNotification;
|
||||
}
|
||||
|
||||
//8th column PROBLEM DESCRIPTI (O.Project matchup to insert in Workorder.ProjectID)
|
||||
string sProblem = SafeGetCellValue(r, 7);
|
||||
Guid projectId = GetMatchingProject(projects, sProblem);
|
||||
if (projectId != Guid.Empty)
|
||||
{
|
||||
w.ProjectID = projectId;
|
||||
}
|
||||
else
|
||||
{
|
||||
//no match, was it because it couldn't match a value which should be logged, or just empty which doesn't need to be logged?
|
||||
if (!string.IsNullOrWhiteSpace(sProblem))
|
||||
{
|
||||
sb.AppendLine("WARNING:\t[Row " + nRow.ToString() + "]\tworkorder \"" + sWorkorderNumber + "\" PROBLEM DESCRIPTION field value: \"" + sProblem + "\" can't be matched to existing data in AyaNova");
|
||||
bWasError = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//9th column CANADA POST WC field (Workorder.Label.Summary)
|
||||
string sCanadaPostWC = SafeGetCellValue254(r, 8);
|
||||
//always overwrite unless empty
|
||||
if (!string.IsNullOrWhiteSpace(sCanadaPostWC))
|
||||
w.Summary = sCanadaPostWC;
|
||||
|
||||
//10th column INBOUND TRACKING # field (WorkorderItem.Label.Summary)
|
||||
string sInboundTrackingNumber = SafeGetCellValue254(r, 9);
|
||||
//always overwrite unless empty
|
||||
if (!string.IsNullOrWhiteSpace(sInboundTrackingNumber))
|
||||
{
|
||||
//iterate just in case there is more than one woitem though there should not be, best to be safe though.
|
||||
foreach (WorkorderItem wi in w.WorkorderItems)
|
||||
{
|
||||
wi.Summary = sInboundTrackingNumber;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//11th column DATA field (WorkorderItem.Label.PriorityID matchup from list)
|
||||
string sData = SafeGetCellValue(r, 10);
|
||||
Guid priorityId = GetMatchingPriority(priorities, sData);
|
||||
if (priorityId != Guid.Empty)
|
||||
{
|
||||
//iterate just in case there is more than one woitem though there should not be, best to be safe though.
|
||||
foreach (WorkorderItem wi in w.WorkorderItems)
|
||||
{
|
||||
wi.PriorityID = priorityId;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//no match, was it because it couldn't match a value which should be logged, or just empty which doesn't need to be logged?
|
||||
if (!string.IsNullOrWhiteSpace(sData))
|
||||
{
|
||||
sb.AppendLine("WARNING:\t[Row " + nRow.ToString() + "]\tworkorder \"" + sWorkorderNumber + "\" DATA field value: \"" + sData + "\" can't be matched to existing data in AyaNova");
|
||||
bWasError = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//12th column CONTACT field (WorkorderItemTravel.Label.TravelDetails)
|
||||
string sContact = SafeGetCellValue(r, 11);
|
||||
if (!string.IsNullOrWhiteSpace(sContact))
|
||||
{
|
||||
|
||||
if (!w.WorkorderItems[0].HasTravel)
|
||||
w.WorkorderItems[0].Travels.Add(w.WorkorderItems[0]);
|
||||
|
||||
w.WorkorderItems[0].Travels[0].TravelDetails = sContact;
|
||||
|
||||
////if there is a travel record then update it
|
||||
// if (w.WorkorderItems[0].HasTravel)
|
||||
// {
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //No travel item? Then it's an error and needs to be appended to the error table
|
||||
// sb.AppendLine("WARNING:\t[Row " + nRow.ToString() + "]\tworkorder \"" + sWorkorderNumber + "\" CONTACT field value: \"" + sData + "\" can't be set because there is no travel record");
|
||||
// bWasError = true;
|
||||
// }
|
||||
}
|
||||
|
||||
#endregion set values from spreadsheet row
|
||||
|
||||
|
||||
if (w.IsSavable)
|
||||
{
|
||||
w.Save();
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tworkorder \"" + sWorkorderNumber + "\" updated in AyaNova");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!w.IsDirty)
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tworkorder \"" + sWorkorderNumber + "\" no changes " + (bWasError ? "made":"required"));
|
||||
}
|
||||
else//must be due to broken rules
|
||||
sb.AppendLine("ERROR:\t[Row " + nRow.ToString() + "]\tworkorder \"" + sWorkorderNumber + "\" couldn't be saved due to broken rules, error was:\r\n----------------------------------\r\n" + w.BrokenRulesText + "\r\n----------------------------------");
|
||||
}
|
||||
|
||||
}
|
||||
Cursor.Current = Cursors.Default;
|
||||
sb.AppendLine("All rows in spreadsheet processed!");
|
||||
//Report results
|
||||
ReportResults(sb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ReportResults(StringBuilder sb)
|
||||
{
|
||||
CopyableMessageBox dlgCMB = new CopyableMessageBox(sb.ToString());
|
||||
dlgCMB.ShowDialog();
|
||||
|
||||
}
|
||||
|
||||
//safe get cell value
|
||||
private string SafeGetCellValue(WorksheetRow r, int nColumn)
|
||||
{
|
||||
object o = r.Cells[nColumn].Value;
|
||||
if (o == null) return "";
|
||||
else
|
||||
return o.ToString();
|
||||
}
|
||||
|
||||
//safe get cell value no longer than 254 characters
|
||||
private string SafeGetCellValue254(WorksheetRow r, int nColumn)
|
||||
{
|
||||
object o = r.Cells[nColumn].Value;
|
||||
if (o == null) return "";
|
||||
else
|
||||
{
|
||||
string ret = o.ToString();
|
||||
return ret.Length <= 254 ? ret : ret.Substring(0, 254);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to match priority from text in spreadsheet
|
||||
/// if no match return guid empty
|
||||
/// </summary>
|
||||
/// <param name="ppl"></param>
|
||||
/// <param name="sToMatch"></param>
|
||||
/// <returns></returns>
|
||||
Guid GetMatchingPriority(PriorityPickList ppl, string sToMatch)
|
||||
{
|
||||
foreach (PriorityPickList.PriorityPickListInfo i in ppl)
|
||||
{
|
||||
if(i.Name.Equals(sToMatch, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
return i.ID;
|
||||
}
|
||||
}
|
||||
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to match Project from text in spreadsheet
|
||||
/// if no match return guid empty
|
||||
/// </summary>
|
||||
/// <param name="l"></param>
|
||||
/// <param name="sToMatch"></param>
|
||||
/// <returns></returns>
|
||||
Guid GetMatchingProject(ProjectList l, string sToMatch)
|
||||
{
|
||||
foreach (ProjectList.ProjectListInfo i in l)
|
||||
{
|
||||
if (i.LT_O_Project.Display.Equals(sToMatch, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
return i.LT_O_Project.Value;
|
||||
}
|
||||
}
|
||||
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
#endregion update
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user