From 80ba48f0f94a1f26ff46e51d9eda31fcc486666a Mon Sep 17 00:00:00 2001 From: John Date: Tue, 27 Jan 2015 19:41:58 +0000 Subject: [PATCH] Creates a meta file used to generate a Complete RO Report --- .../Exe/RefObj/CmpRpt/App.ico | Bin 0 -> 1078 bytes .../Exe/RefObj/CmpRpt/AssemblyInfo.cs | 100 +++++++ .../Exe/RefObj/CmpRpt/CmpRpt.cs | 248 ++++++++++++++++++ .../Exe/RefObj/CmpRpt/CmpRpt.csproj | 157 +++++++++++ .../Exe/RefObj/CmpRpt/CmpRpt.csproj.vspscc | 10 + .../Exe/RefObj/CmpRpt/CmpRpt.resx | 102 +++++++ .../Exe/RefObj/CmpRpt/FixRev.Bat | 4 + .../Exe/RefObj/CmpRpt/app.config | 6 + 8 files changed, 627 insertions(+) create mode 100644 PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/App.ico create mode 100644 PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/AssemblyInfo.cs create mode 100644 PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.cs create mode 100644 PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.csproj create mode 100644 PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.csproj.vspscc create mode 100644 PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.resx create mode 100644 PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/FixRev.Bat create mode 100644 PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/app.config diff --git a/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/App.ico b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/App.ico new file mode 100644 index 0000000000000000000000000000000000000000..3a5525fd794f7a7c5c8e6187f470ea3af38cd2b6 GIT binary patch literal 1078 zcmeHHJr05}7=1t!Hp3A*8IHkVf+j?-!eHY14Gtcw1Eb*_9>Bq^zETJ@GKj{_2j4$w zo9}xCh!8{T3=X##Skq>ikMjsvB|y%crWBM2iW(4pI}c%z6%lW!=~4v77#3{z!dmB1 z__&l)-{KUYR+|8|;wB^R|9ET$J@(@=#rd^=)qs85?vAy(PSF5CyNkus435LVkZ$rj zNw|JG-P7^hF<(;#o*Vk}5R#e|^13tBbQkeF?djULtvqyxd3<{9 literal 0 HcmV?d00001 diff --git a/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/AssemblyInfo.cs b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/AssemblyInfo.cs new file mode 100644 index 00000000..0d363e33 --- /dev/null +++ b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/AssemblyInfo.cs @@ -0,0 +1,100 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("CmpRpt")] +[assembly: AssemblyDescription("Get RO info for Complete RO Report")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Volian Enterprises Inc")] +[assembly: AssemblyProduct("PROMS")] +[assembly: AssemblyCopyright("2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.1.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.cs b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.cs new file mode 100644 index 00000000..342184c4 --- /dev/null +++ b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.cs @@ -0,0 +1,248 @@ +/********************************************************************************************* + * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. + * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE + * ------------------------------------------------------------------------------ + * $Workfile: CmpRpt.cs $ $Revision: 3 $ + * $Author: Jsj $ $Date: 6/08/05 4:31p $ + * + * $History: CmpRpt.cs $ + * + * ***************** Version 3 ***************** + * User: Jsj Date: 6/08/05 Time: 4:31p + * Updated in $/EXE/RefObj/CmpRpt + * cleanup + * + * ***************** Version 2 ***************** + * User: Jsj Date: 1/08/04 Time: 2:51p + * Updated in $/EXE/RefObj/CmpRpt + * constructor of RODB() class changed + * + * ***************** Version 1 ***************** + * User: Kathy Date: 11/11/02 Time: 7:17a + * Created in $/EXE/RefObj/CmpRpt + *********************************************************************************************/ +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using System.IO; +using System.Data; +using RODBInterface; + + +// CmpRpt reads data for the RO database and puts the data into the +// temporary file, 'print.tmp'. After this, it is sorted and printed. +namespace CmpRpt +{ + // Form1 just acts as the container for this app. + public class Form1 : System.Windows.Forms.Form + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; + + public Form1() + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + } + + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // Form1 + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(292, 273); + this.Name = "Form1"; + this.Text = "Form1"; + + } + #endregion + + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main(string[] args) + { + if (args.Length <= 0) return; // nothing to do + bool success; + VlnXmlElement rootXml; + VlnXmlDocument myroXmlDoc; + string recid=null; + string tbl=null; + RODB myrodb=null; + + // the next two lists contain group headers for the reports. + ArrayList headers = new ArrayList(); + ArrayList reversehdrs = new ArrayList(); + + //if (args.Length <= 0) return; + //// if an RO directory path was passed in, then change the + //// current working directory to it. + //// this path will also be used to generate a connection string + //// for the Access database. + //if (args.Length == 2) + //{ + // // MessageBox.Show(args[1],"args[1]"); + // string path = args[0]; + // Directory.SetCurrentDirectory(path); + // tbl = args[1].Substring(0, 4); + // //tbl = args[1].Substring(13,4); + // // recid = args[1].Substring(17,8); + // if (args[1].Length > 4) + // recid = args[1].Substring(4, 8); + // // myrodb = new RODB(path); + //} + //else + //{ + // tbl = args[0].Substring(0, 4); + // recid = args[0].Substring(4, 8); + // // myrodb = new RODB(Directory.GetCurrentDirectory()); + //} +/******/ + // if an RO directory path was passed in, then change the + // current working directory to it. + // this path will also be used to generate a connection string + // for the Access database. + string roIdArg = BuildROList(args); + string[] roIDList = roIdArg.Split(','); + if (args.Length == 2) + { + string path = args[0]; + Directory.SetCurrentDirectory(path); + } + myrodb = new RODB(Directory.GetCurrentDirectory()); + VlnXmlElement rptele=null; + + // Add the root to the tree + myroXmlDoc = myrodb.RODB_GetRoot(); + + rootXml = (VlnXmlElement) myroXmlDoc.FirstChild; + success = myrodb.RODB_GetRootGroups(rootXml); + if (success == false) return; + + foreach (string roid in roIDList) + { + tbl = roid.Substring(0, 4); + recid = (roid.Length > 4) ? roid.Substring(4, 8) : null; + + // if the table & recid = all zeros, we have a request + // for all ROs, otherwise it's a request for specific RO(s) + if (tbl == "0000" && recid != null && recid == "00000000") + { + // the report element becomes the root. + rptele = rootXml; + } + else + { + // from the input tbl string, get a table name. + int itbl = System.Convert.ToInt32(tbl, 16); + string stbl = System.Convert.ToString(itbl, 10); + string pstbl = stbl.PadLeft(6, '0'); + string tbname = "RO" + pstbl; + + // read in this element from the table. + rptele = myrodb.RODB_ReadRO(tbname, recid); + + VlnXmlElement parent; + string parentid; + parentid = rptele.GetAttribute("ParentID"); + string rpteleParentid = parentid; + + // walk up tree to get the path through the tree. + VlnXmlElement child = rptele; + while (parentid != null && parentid != "00000000") + { + parent = myrodb.RODB_ReadRO(tbname, parentid); + if (parent != null) + { + parentid = parent.GetAttribute("ParentID"); + if (parentid == "00000000") + { + reversehdrs.Add(parent.InnerText); + break; + } + parent.AppendChild(child); + child = parent; + reversehdrs.Add(parent.GetAttribute("MenuTitle")); + } + else + parentid = null; + } + + // Now hook this into the top part of tree by looking at the table + // names. + VlnXmlElement group = (VlnXmlElement)rootXml.FirstChild; + while (group != null) + { + string curtbname = group.GetAttribute("Table"); + // hook it in here. + if (curtbname == tbname) + { + if (rpteleParentid != "00000000") + group.AppendChild(child); + else // if this is a top group, just reset rept ele + rptele = group; + break; + } + group = (VlnXmlElement)group.NextSibling; + } + // Set up the headers array, it's in reverse order since we walked + // up the tree, not down. + int cnt = reversehdrs.Count; + for (int i = cnt - 1; i >= 0; i--) + headers.Add(reversehdrs[i]); + } + rptele.Show(myrodb,headers); + headers.Clear(); + reversehdrs.Clear(); + }// end foreach roid + + } + + private static string BuildROList(string[] args) + { + string parm2 = args[args.Length - 1]; + string roIdArg = null; + if (parm2.StartsWith("/f=")) + { + FileInfo fi = new FileInfo(parm2.Substring(3)); + using (StreamReader sr = fi.OpenText()) + { + roIdArg = sr.ReadToEnd(); + sr.Close(); + } + } + else + roIdArg = parm2; + return roIdArg; + } + } +} diff --git a/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.csproj b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.csproj new file mode 100644 index 00000000..50a23278 --- /dev/null +++ b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.csproj @@ -0,0 +1,157 @@ + + + Local + 8.0.50727 + 2.0 + {C4293263-EA9C-11D6-8515-00A0CC271352} + Debug + AnyCPU + App.ico + + + CmpRpt + + + JScript + Grid + IE50 + false + WinExe + CmpRpt + OnBuildSuccess + CmpRpt.Form1 + + + + + SAK + SAK + SAK + SAK + + + ..\..\..\..\VEPROMS User Interface\bin\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + + + true + 4096 + false + + + false + false + false + false + 4 + full + prompt + x86 + + + ..\..\..\..\Ve-proms.net\BIN\ + false + 285212672 + false + + + TRACE + + + false + 4096 + false + + + true + false + false + false + 4 + none + prompt + + + true + ..\..\..\..\VEPROMS User Interface\bin\Debug\ + DEBUG;TRACE + 285212672 + full + x86 + prompt + + + bin\x86\Release\ + TRACE + 285212672 + true + + + x86 + prompt + + + + DBEncapsulation + ..\..\..\LibSource\DBEncapsulation\bin\Debug\DBEncapsulation.dll + False + + + RODBInterface + ..\..\..\LibSource\RODBInterface\bin\Debug\RODBInterface.dll + False + + + System + + + System.Data + + + System.Drawing + + + System.Windows.Forms + + + System.XML + + + VlnStatus + ..\..\..\LibSource\VlnStatus\bin\Debug\VlnStatus.dll + False + + + + + + + + Code + + + Form + + + CmpRpt.cs + Designer + + + + + {0C782592-AA05-11D6-84D1-00A0CC271352} + ROFields + + + + + cmd /c "$(ProjectDir)FixRev.bat" + + + + \ No newline at end of file diff --git a/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.csproj.vspscc b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.csproj.vspscc new file mode 100644 index 00000000..f96cea95 --- /dev/null +++ b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "relative:Exe\\RefObj\\CmpRpt" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.resx b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.resx new file mode 100644 index 00000000..add6c98e --- /dev/null +++ b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/CmpRpt.resx @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Form1 + + \ No newline at end of file diff --git a/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/FixRev.Bat b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/FixRev.Bat new file mode 100644 index 00000000..384efc62 --- /dev/null +++ b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/FixRev.Bat @@ -0,0 +1,4 @@ +PUSHD ..\..\..\ReferencedObjects\Exe\RefObj\CmpRpt" +"..\..\..\..\AdjustBuildRevision\bin\Debug\AdjustBuildRevision" "%CD%\AssemblyInfo.cs" +POPD +pause diff --git a/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/app.config b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/app.config new file mode 100644 index 00000000..3124cd94 --- /dev/null +++ b/PROMS/ReferencedObjects/Exe/RefObj/CmpRpt/app.config @@ -0,0 +1,6 @@ + + + + + +