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>{757B673A-9D50-4341-B5D3-82295F9F0D4E}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AyaNova.Plugin.RepairTekCPC</RootNamespace>
|
||||
<AssemblyName>AyaNova.Plugin.RepairTek3</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\RepairTek3\</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\RepairTek3\</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.RepairTek3/CopyableMessageBox.resx
Normal file
197
source/Plugins/AyaNova.Plugin.RepairTek3/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
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAA
|
||||
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.RepairTek3")]
|
||||
[assembly: AssemblyDescription("RepairTek - Create Service Orders plugin for AyaNova")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ground Zero Tech-Works Inc.")]
|
||||
[assembly: AssemblyProduct("AyaNova.Plugin.RepairTek3")]
|
||||
[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("1A8DE4EF-A6B6-4B50-B2D3-44BBB43B289E")]
|
||||
|
||||
// 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")]
|
||||
794
source/Plugins/AyaNova.Plugin.RepairTek3/RepairTek.cs
Normal file
794
source/Plugins/AyaNova.Plugin.RepairTek3/RepairTek.cs
Normal file
@@ -0,0 +1,794 @@
|
||||
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 - Create Service Orders"; }
|
||||
}
|
||||
|
||||
public string PluginVersion
|
||||
{
|
||||
get { return "7.2"; }
|
||||
}
|
||||
|
||||
public string About
|
||||
{
|
||||
get
|
||||
{
|
||||
return "AyaNova RepairTek - Create Service Orders plugin\r\n" +
|
||||
"Copyright 2009-2014 Ground Zero Tech-Works Inc.";
|
||||
}
|
||||
}
|
||||
|
||||
public Guid PluginID
|
||||
{
|
||||
get { return new Guid("{1A8DE4EF-A6B6-4B50-B2D3-44BBB43B289E}"); }
|
||||
}
|
||||
|
||||
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("REPAIRTEK3", "RepairTek - Create Service Orders", 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 "REPAIRTEK3":
|
||||
{
|
||||
Update();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
#endregion single object command
|
||||
|
||||
#endregion menu commands
|
||||
|
||||
#endregion
|
||||
|
||||
/*
|
||||
THIS IS THE "REPAIRTEK 3" PLUGIN - Create Service Orders
|
||||
|
||||
*/
|
||||
|
||||
#region REPAIRTEK3 Create 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.
|
||||
|
||||
|
||||
Plugin specifications:
|
||||
|
||||
provide ability for the user to select any xlxs file
|
||||
i.e. browse feature so he can select file from any folder, etc
|
||||
xlxs file will have a header row, and then any number of rows
|
||||
as per example xlxs file Sample_OpenWO_onerow.xlxs
|
||||
a new workorder is to be created for each row
|
||||
the new workorder to have in it selected the Workorder Status with specific text and case of OPEN ORDERS
|
||||
and the following imported:
|
||||
as per example xlxs file which identifies which specific AyaNova field corresponds to which column that will be imported Sample_OpenWO_columnsidentified.xlxs (this sample has an extra header row identifying in default what the field corresponds to as well as additional row under with more info - NOT to be used as example xlxs file imported.
|
||||
A column: workorder # / WO#
|
||||
This column will be ignored.
|
||||
B column: Client / CLIENT
|
||||
This column equates to an existing client record already in AyaNova.
|
||||
If client is not yet entered in AyaNova, skip creating workorder - and indicate so in the text dialogue that displays.
|
||||
Expectation that will always be the same client, but just in case...
|
||||
C and D column:
|
||||
will be ignored
|
||||
E column: Unit / UNIT
|
||||
If existing unit with that exact serial number and case owned by the client above is already entered into AyaNova, this unit will be selected for this new workorder.
|
||||
If there is not an existing unit with that exact serial number and case owned by the client above, the unit record to be created ( with serial number and client who owns is all that is needed).
|
||||
F column: Client Ref # / PULSE INCIDENT
|
||||
Workorder.Label.CustomerReferenceNumber
|
||||
Import the text from this column into the Client Ref # field
|
||||
G column: Contact / Comments o RMA#
|
||||
Workorder.Label.CustomerContactName
|
||||
Import the text from this column into the Contact field
|
||||
H column: Project / Problem Description
|
||||
O.Project
|
||||
Select existing Project record with exact same spelling and case
|
||||
If there is not an existing Project record with exact same spelling and case as that in the xlxs file, skip importing BUT identify in the text dialogue box missing project record
|
||||
I column: Summary / WC#
|
||||
Workorder.Label.Summary
|
||||
Import the text from this column into the Summary field
|
||||
J column: Item Summary / INCOMING WAYBILL
|
||||
WorkorderItem.Label.Summary
|
||||
Import the text from this column into the Item Summary field
|
||||
K column: Priority / DATA
|
||||
WorkorderItem.Label.PriorityID
|
||||
Select existing Priority record with exact same spelling and case
|
||||
If there is not an existing Priority record with exact same spelling and case as that in the xlxs file, skip creating workorder and indicate so in the text dialogue
|
||||
L column: Travel Details/ CONTACT
|
||||
WorkorderItemTravel.Label.TravelDetails
|
||||
Import the text from this column into a new travel record's Travel Details field
|
||||
M column: Workorder Item Type / SITE ADDRESS
|
||||
WorkorderItem.Label.TypeID
|
||||
Select existing Workorder Item Type record with exact same spelling and case
|
||||
If there is not an existing Workorder Item Type record with exact same spelling and case as that in the xlxs file, leave blank and indicate had to do so in the text dialogue window
|
||||
|
||||
|
||||
*
|
||||
*
|
||||
* UPDATE: November 17th, apparently not correct in how missing data is handled, this is an addendum:
|
||||
*
|
||||
* B column: Client / CLIENT
|
||||
If there is not an existing Client record with exact same spelling and case as that in the xlxs file,
|
||||
create the client record, and then continue with creating the workorder and importing the fields.
|
||||
|
||||
|
||||
H column: Project / Problem Description
|
||||
If there is not an existing Project record with exact same spelling and case as that in the xlxs file
|
||||
-leave field blank in the service workorder, indicate had to do so in the text dialogue window and continue to create this workorder..
|
||||
|
||||
|
||||
K column: Priority / DATA
|
||||
If there is not an existing Priority record with exact same spelling and case as that in the xlxs file,
|
||||
-leave field blank in the service workorder, indicate had to do so in the text dialogue window and continue to create this workorder.
|
||||
|
||||
|
||||
M column: Workorder Item Type / SITE ADDRESS
|
||||
If there is not an existing Workorder Item Type record with exact same spelling and case as that in the xlxs file,
|
||||
leave field blank in the service workorder and indicate had to do so in the text dialogue window and continue to create this workorder.
|
||||
|
||||
|
||||
*
|
||||
* UPDATE: 11/18/2014 blank fields should be also reported as warning in unmatchable warning for columns H K and M
|
||||
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* UPDATE: 11/26/2014
|
||||
*
|
||||
Hi Joyce, I added some answers below and attached sample with missing fields. Columns A and G will always be blank so no error indication is required for these.
|
||||
|
||||
The same error message can be used as per current plugin that you just created. Sorry I don’t have anything to create currently and I can’t remember the message that it would display. If you cannot retrieve, message can be ‘skipped missing field(s)’.
|
||||
|
||||
Thanks.Regards, Frank Sanzo
|
||||
|
||||
From: AyaNova Sales & Support [mailto:support@ayanova.com]
|
||||
Sent: Wednesday, November 26, 2014 11:32 AM
|
||||
To: Frank Sanzo
|
||||
Subject: Re: FW: Creating new Service Order using selected xlxs
|
||||
|
||||
Hello Frank
|
||||
|
||||
I have received response back from development. Please provide the following:
|
||||
|
||||
In reference to "that if any field is blank," are you referring to if a field in the row in a XLXS file that is blank? - YES
|
||||
Please identify which specific field(s) (field in which columns) or if all fields – all fields
|
||||
Provide a copy of an existing xlxs file that shows examples of blank in each field (i.e. one row has one specific field blank, a second row has a different specific field blank, a third row has two specific fields blank and so on )
|
||||
Provide examples of the indication in the dialogue box you would want to show for these that would occur in #3 above
|
||||
|
||||
Thank you!
|
||||
|
||||
- Joyce
|
||||
www.ayanova.com
|
||||
|
||||
On 11/25/2014 4:51 PM, Frank Sanzo wrote:
|
||||
|
||||
Hi Joyce, this plugin does work properly as per the emails but I may have left out an action
|
||||
that if any field is blank, not just the pulldowns,
|
||||
that we can also get an indication in dialogue box that it has to do so.
|
||||
And continue to create the workorder. Please let me know the charge to make this change. Thank you.
|
||||
|
||||
*
|
||||
*
|
||||
* DEVELOPMENT RESPONSE:
|
||||
* Changes made to plugin column handling code:
|
||||
|
||||
Column A - No change, is ignored, always blank, as per instructions won't report
|
||||
Column B - No change, client name if empty already reports as Error in log and won't import that row.
|
||||
Column C - No change, not used by plugin, will not report empty values in this column
|
||||
Column D - No change, not used by plugin, will not report empty values in this column
|
||||
Column E - No change, Serial column. Plugin uses this field to detect empty rows and so this is a required column to import the row, if this column is empty it will just skip that row assuming it's an empty row. Have left it unchanged without reporting if this field is empty because the import spreadsheets have many empty rows at the bottom and if this were to report every empty row it would be a lot of redundant information.
|
||||
if Frank expects there could be actual rows that have data in other fields but are missing the serial number then we should change how it detects empty rows to check more columns, however the way it works now is simple and reliable for detecting empppty rows if there will always be a serial number.
|
||||
Column F - Now reports if column is empty in import file.
|
||||
Column G - No change, is ignored, always blank, as per instructions won't report
|
||||
Column H - Now reports if column is empty in import file. (Unchanged: If it is not empty but can't be matched to an existing value (project) reports as before exact value and fact it couldn't be matched.)
|
||||
COLUMN I - Now reports if column is empty in import file.
|
||||
COLUMN J - Now reports if column is empty in import file.
|
||||
COLUMN K - Now reports if column is empty in import file. (Unchanged: If it is not empty but can't be matched to an existing value (Priority) reports as before exact value and fact it couldn't be matched.)
|
||||
Column L - Now reports if column is empty in import file.
|
||||
Column M - Now reports if column is empty in import file. (Unchanged: If it is not empty but can't be matched to an existing value (TypeID) reports as before exact value and fact it couldn't be matched.)
|
||||
|
||||
*
|
||||
*
|
||||
*
|
||||
* Update December 10 2014
|
||||
* New column N
|
||||
*
|
||||
|
||||
The existing Create Service Order plugin is to be further modified so that if there is text in column N for that row:
|
||||
|
||||
a Misc Expense record is created for the created workorder
|
||||
the text in column N is copied to the Description field of the Misc Expense record
|
||||
all other fields of the Misc record are left blank or unselected
|
||||
|
||||
|
||||
If there is no text in column N for that row:
|
||||
|
||||
a warning to display to the report at the end
|
||||
|
||||
|
||||
* */
|
||||
#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();
|
||||
|
||||
//fetch workorder item type list
|
||||
WorkorderItemTypePickList typesList = WorkorderItemTypePickList.GetList();
|
||||
|
||||
//default status
|
||||
WorkorderStatusPickList wspl = WorkorderStatusPickList.GetList();
|
||||
Guid openOrderStatus = GetMatchingStatus(wspl, "OPEN ORDERS");
|
||||
if (openOrderStatus == Guid.Empty)
|
||||
{
|
||||
MessageBox.Show("Error: Workorder status of \"OPEN ORDERS\" not found in AyaNova database and is required to proceed.");
|
||||
return;
|
||||
}
|
||||
|
||||
//default unit model:
|
||||
//CN50AQU1LP20
|
||||
UnitModelPickList umpl = UnitModelPickList.GetList();
|
||||
Guid defaultUnitModelId = GetMatchingUnitModel(umpl, "CN50AQU1LP20");
|
||||
if (defaultUnitModelId == Guid.Empty)
|
||||
{
|
||||
MessageBox.Show("Error: Unit model \"CN50AQU1LP20\" not found in AyaNova database and is required to proceed.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//client list
|
||||
// ClientPickList cpl = ClientPickList.GetList();
|
||||
|
||||
//Iterate the workorders
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
|
||||
int nRow = 0;
|
||||
foreach (WorksheetRow r in workbook.Worksheets[0].Rows)
|
||||
{
|
||||
nRow++;
|
||||
|
||||
//wo number not used in this plugin except to skip over empty / title row
|
||||
string sWorkorderNumber = SafeGetCellValue(r, 0);
|
||||
//skip over empty or title rows
|
||||
if (string.IsNullOrEmpty(sWorkorderNumber))
|
||||
sWorkorderNumber = "UNKNOWN";
|
||||
|
||||
if (sWorkorderNumber.StartsWith("W"))
|
||||
continue;
|
||||
//empty row check, if no sn then it's empty
|
||||
string sSerial = SafeGetCellValue(r, 4);
|
||||
if (string.IsNullOrWhiteSpace(sSerial))
|
||||
{
|
||||
//can't do this because there are so many emppty rows it would fill up the dialog box
|
||||
//If more stringent empty row checking is required then we need to check all columns or some key ones in combination
|
||||
//if(nRow > 1)
|
||||
// sb.AppendLine("WARNING:\t[Row " + nRow.ToString() + "]\tSerial field (column E) value is blank, assuming empty row and skipping.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Workorder w = Workorder.NewItem(WorkorderTypes.Service);
|
||||
w.WorkorderService.WorkorderStatusID = openOrderStatus;
|
||||
//Need a workorder item
|
||||
if (w.WorkorderItems.Count < 1)
|
||||
w.WorkorderItems.Add(w);
|
||||
|
||||
#region Set values from spreadsheet row
|
||||
|
||||
//B 2nd column Client name
|
||||
string sClient = SafeGetCellValue(r, 1);
|
||||
if (string.IsNullOrWhiteSpace(sClient))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tCLIENT field value is blank in import file can't match or create without a client name - NOT IMPORTED!");
|
||||
continue;
|
||||
}
|
||||
Guid clientId = GetSertClient(sClient);
|
||||
w.ClientID = clientId;
|
||||
|
||||
//E 5th column UNIT
|
||||
//Moved this up in order to check for empty rows
|
||||
//string sSerial = SafeGetCellValue(r, 4);
|
||||
Guid unitId = GetSertUnit(sSerial, clientId, defaultUnitModelId);
|
||||
w.WorkorderItems[0].UnitID = unitId;
|
||||
|
||||
//F 6th column PULSE INCIDENT (Workorder.Label.CustomerReferenceNumber)
|
||||
string sPulse = SafeGetCellValue254(r, 5);
|
||||
if (string.IsNullOrWhiteSpace(sPulse))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tPULSE INCIDENT (column F) is blank in import file.");
|
||||
}
|
||||
w.CustomerReferenceNumber = sPulse;
|
||||
|
||||
//G 7th column Comments / RMA field (Workorder.Label.CustomerContactName)
|
||||
string sRMA = SafeGetCellValue254(r, 6);
|
||||
w.CustomerContactName = sRMA;
|
||||
|
||||
//H 8th column PROBLEM DESCRIPTI (O.Project matchup to insert in Workorder.ProjectID)
|
||||
string sProblem = SafeGetCellValue(r, 7);
|
||||
if (string.IsNullOrWhiteSpace(sProblem))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tPROBLEM DESCRIPTION (column H) is blank in import file.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Guid projectId = GetMatchingProject(projects, sProblem);
|
||||
if (projectId != Guid.Empty)
|
||||
{
|
||||
w.ProjectID = projectId;
|
||||
}
|
||||
else
|
||||
{
|
||||
//no match, this is not an error just log as warning
|
||||
sb.AppendLine("WARNING:\t[Row " + nRow.ToString() + "]\tPROBLEM DESCRIPTION field value: \"" + sProblem + "\" no match, left blank.");
|
||||
}
|
||||
}
|
||||
|
||||
//I 9th column Summary / WC field (Workorder.Label.Summary)
|
||||
string sSummary = SafeGetCellValue254(r, 8);
|
||||
if (string.IsNullOrWhiteSpace(sSummary))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tSummary / WC (column I) is blank in import file.");
|
||||
}
|
||||
//always overwrite unless empty
|
||||
if (!string.IsNullOrWhiteSpace(sSummary))
|
||||
w.Summary = sSummary;
|
||||
|
||||
//J 10th column INCOMING WAYBILL field (WorkorderItem.Label.Summary)
|
||||
string sIncomingWayBill = SafeGetCellValue254(r, 9);
|
||||
if (string.IsNullOrWhiteSpace(sIncomingWayBill))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tINCOMING WAYBILL (column J) is blank in import file.");
|
||||
}
|
||||
w.WorkorderItems[0].Summary = sIncomingWayBill;
|
||||
|
||||
//K 11th column Priority / DATA field (WorkorderItem.Label.PriorityID matchup from list)
|
||||
string sData = SafeGetCellValue(r, 10);
|
||||
if (string.IsNullOrWhiteSpace(sData))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tPriority / DATA (column K) is blank in import file.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Guid priorityId = GetMatchingPriority(priorities, sData);
|
||||
if (priorityId != Guid.Empty)
|
||||
{
|
||||
w.WorkorderItems[0].PriorityID = priorityId;
|
||||
}
|
||||
else
|
||||
{
|
||||
//no match - log warning
|
||||
sb.AppendLine("WARNING:\t[Row " + nRow.ToString() + "]\tPriority / DATA field value: \"" + sData + "\" no match, left blank.");
|
||||
}
|
||||
}
|
||||
|
||||
//L 12th column CONTACT field (WorkorderItemTravel.Label.TravelDetails)
|
||||
string sContact = SafeGetCellValue(r, 11);
|
||||
if (string.IsNullOrWhiteSpace(sContact))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tCONTACT (column L) is blank in import file.");
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(sContact))
|
||||
{
|
||||
if (!w.WorkorderItems[0].HasTravel)
|
||||
w.WorkorderItems[0].Travels.Add(w.WorkorderItems[0]);
|
||||
w.WorkorderItems[0].Travels[0].TravelDetails = sContact;
|
||||
}
|
||||
|
||||
//M 13th column Workorder Item Type / SITE ADDRESS field (WorkorderItem.Label.TypeID matchup from list)
|
||||
string sSiteAddress = SafeGetCellValue(r, 12);
|
||||
if (string.IsNullOrWhiteSpace(sSiteAddress))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tSITE ADDRESS (column M) is blank in import file.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Guid typeId = GetMatchingType(typesList, sSiteAddress);
|
||||
if (typeId != Guid.Empty)
|
||||
{
|
||||
w.WorkorderItems[0].TypeID = typeId;
|
||||
}
|
||||
else
|
||||
{
|
||||
//no match - log warning
|
||||
sb.AppendLine("WARNING:\t[Row " + nRow.ToString() + "]\tWorkorder Item Type / SITE ADDRESS field value: \"" + sSiteAddress + "\" no match, left blank.");
|
||||
}
|
||||
}
|
||||
|
||||
//N 14th column POSTAL CODE / goes into a new misc expense record's description field
|
||||
string sPostalCode = SafeGetCellValue254(r, 13);
|
||||
if (string.IsNullOrWhiteSpace(sPostalCode))
|
||||
{
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tPOSTAL CODE (column N) is blank in import file.");
|
||||
}
|
||||
else
|
||||
{
|
||||
w.WorkorderItems[0].Expenses.Add(w.WorkorderItems[0]);
|
||||
w.WorkorderItems[0].Expenses[0].Description = sPostalCode;
|
||||
}
|
||||
|
||||
#endregion set values from spreadsheet row
|
||||
|
||||
if (w.IsSavable)
|
||||
{
|
||||
w = (Workorder)w.Save();
|
||||
sb.AppendLine("INFO:\t[Row " + nRow.ToString() + "]\tworkorder \"" + w.WorkorderService.ServiceNumber + "\" created in AyaNova");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine("ERROR:\t[Row " + nRow.ToString() + "]\tcouldn'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 status from text in spreadsheet
|
||||
/// if no match return guid empty
|
||||
/// </summary>
|
||||
/// <param name="ppl"></param>
|
||||
/// <param name="sToMatch"></param>
|
||||
/// <returns></returns>
|
||||
Guid GetMatchingStatus(WorkorderStatusPickList ppl, string sToMatch)
|
||||
{
|
||||
foreach (WorkorderStatusPickList.WorkorderStatusPickListInfo i in ppl)
|
||||
{
|
||||
if (i.Name.Equals(sToMatch, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
return i.ID;
|
||||
}
|
||||
}
|
||||
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
/// <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 Workorder item type from text in spreadsheet
|
||||
/// if no match return guid empty
|
||||
/// </summary>
|
||||
/// <param name="ppl"></param>
|
||||
/// <param name="sToMatch"></param>
|
||||
/// <returns></returns>
|
||||
Guid GetMatchingType(WorkorderItemTypePickList l, string sToMatch)
|
||||
{
|
||||
foreach (WorkorderItemTypePickList.WorkorderItemTypePickListInfo i in l)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to match Client from text in spreadsheet
|
||||
/// if no match return guid empty
|
||||
/// </summary>
|
||||
/// <param name="l"></param>
|
||||
/// <param name="sToMatch"></param>
|
||||
/// <returns></returns>
|
||||
Guid GetMatchingClient(ClientPickList l, string sToMatch)
|
||||
{
|
||||
foreach (ClientPickList.ClientPickListInfo i in l)
|
||||
{
|
||||
if (i.Name.Equals(sToMatch, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
return i.ID;
|
||||
}
|
||||
}
|
||||
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to match unit model from text in spreadsheet
|
||||
/// if no match return guid empty
|
||||
/// </summary>
|
||||
/// <param name="ppl"></param>
|
||||
/// <param name="sToMatch"></param>
|
||||
/// <returns></returns>
|
||||
Guid GetMatchingUnitModel(UnitModelPickList ppl, string sToMatch)
|
||||
{
|
||||
foreach (UnitModelPickList.UnitModelPickListInfo i in ppl)
|
||||
{
|
||||
//Note: name is combined number and name fields here so
|
||||
//can't directly match
|
||||
if (i.Name.Contains(sToMatch))
|
||||
{
|
||||
return i.ID;
|
||||
}
|
||||
}
|
||||
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// gets matching unit ID or, if it's not there, inserts one and returns that Id
|
||||
/// </summary>
|
||||
/// <param name="serialNumber"></param>
|
||||
/// <param name="ClientId"></param>
|
||||
/// <returns></returns>
|
||||
Guid GetSertUnit(string serialNumber, Guid ClientId, Guid UnitModelId)
|
||||
{
|
||||
|
||||
UnitPickList upl = UnitPickList.GetListByClient(ClientId);
|
||||
foreach (UnitPickList.UnitPickListInfo i in upl)
|
||||
{
|
||||
if (i.Serial == serialNumber)
|
||||
return i.ID;
|
||||
}
|
||||
|
||||
//here due to no match, so make one now
|
||||
Unit u = Unit.NewItem();
|
||||
u.ClientID = ClientId;
|
||||
u.Serial = serialNumber;
|
||||
u.UnitModelID = UnitModelId;
|
||||
u = (Unit)u.Save();
|
||||
return u.ID;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// gets matching client ID or, if it's not there, inserts one and returns that Id
|
||||
/// </summary>
|
||||
/// <param name="serialNumber"></param>
|
||||
/// <param name="ClientId"></param>
|
||||
/// <returns></returns>
|
||||
Guid GetSertClient(string sClientName)
|
||||
{
|
||||
Guid ret = Client.IDFromName(sClientName);
|
||||
if (ret != Guid.Empty)
|
||||
return ret;
|
||||
|
||||
Client c = Client.NewItem();
|
||||
c.Name = sClientName;
|
||||
|
||||
c = (Client)c.Save();
|
||||
return c.ID;
|
||||
}
|
||||
|
||||
#endregion update
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user