From 0ee3442b0db1e1f4e83a6696c06d57f50603aad3 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 12 Jun 2015 14:10:41 +0000 Subject: [PATCH] --- PROMS/PromsGetDoc/PROMSGETDOC/App.config | 6 -- PROMS/PromsGetDoc/PROMSGETDOC/Program.cs | 80 ------------------- .../PROMSGETDOC/PromsGetDoc.csproj | 58 -------------- PROMS/PromsGetDoc/PROMSGETDOC/PromsGetDoc.sln | 22 ----- 4 files changed, 166 deletions(-) delete mode 100644 PROMS/PromsGetDoc/PROMSGETDOC/App.config delete mode 100644 PROMS/PromsGetDoc/PROMSGETDOC/Program.cs delete mode 100644 PROMS/PromsGetDoc/PROMSGETDOC/PromsGetDoc.csproj delete mode 100644 PROMS/PromsGetDoc/PROMSGETDOC/PromsGetDoc.sln diff --git a/PROMS/PromsGetDoc/PROMSGETDOC/App.config b/PROMS/PromsGetDoc/PROMSGETDOC/App.config deleted file mode 100644 index 8e156463..00000000 --- a/PROMS/PromsGetDoc/PROMSGETDOC/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/PROMS/PromsGetDoc/PROMSGETDOC/Program.cs b/PROMS/PromsGetDoc/PROMSGETDOC/Program.cs deleted file mode 100644 index 39dfeee4..00000000 --- a/PROMS/PromsGetDoc/PROMSGETDOC/Program.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Data; -using System.Data.Sql; -using System.Data.SqlClient; -using System.IO; - -namespace PromsGetDoc -{ - class Program - { - // arguments are: - // docId - // filename/pathname for resulting word doc - // sql server name - // database name - - // Can be run from command line or from macro in microsoft office tools as shown here: - // Sub Macro1() - // Call Shell("""Path_To_Exe\PromsGetDoc.exe"" 5 C:\temp\sample3.doc .\sqlexpress veproms_app", vbNormalFocus) - // End Sub - static void Main(string[] args) - { - if (args.Length != 4) - { - Console.WriteLine("Need 4 arguments: DocId, Output File/Path, Server Name, Database Name"); - return; - } - byte[] doc = null; - int _docId = int.Parse(args[0]); - string connectionStr = string.Format(@"Data Source={0};Initial Catalog={1};Integrated Security=True", args[2], args[3]); - try - { - using (SqlConnection cn = new SqlConnection(connectionStr)) - { - cn.Open(); // do I need this? - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocument"; - cm.Parameters.AddWithValue("@DocID", _docId); - cm.CommandTimeout = 100; - using (SqlDataReader dr = cm.ExecuteReader()) - { - if (!dr.Read()) - { - Console.WriteLine("ERROR: No Record Found"); - return; - } - doc = (byte[])dr.GetValue(2); - } - } - } - } - catch (Exception ex) - { - Console.WriteLine("ERROR: Could not access/read data. Check server and database name. " + ex.Message); - return; - } - if (doc != null) - { - try - { - FileInfo fi = new FileInfo(args[1]); - FileStream fs = fi.Create(); - fs.Write(doc, 0, doc.Length); - fs.Close(); - } - catch (Exception ex1) - { - Console.WriteLine("ERROR: Could not write Word file. " + ex1.Message); - return; - } - } - } - } -} diff --git a/PROMS/PromsGetDoc/PROMSGETDOC/PromsGetDoc.csproj b/PROMS/PromsGetDoc/PROMSGETDOC/PromsGetDoc.csproj deleted file mode 100644 index 6d87707d..00000000 --- a/PROMS/PromsGetDoc/PROMSGETDOC/PromsGetDoc.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Debug - AnyCPU - {97C3A741-3C26-453D-9F2F-F083CB62B45C} - Exe - Properties - PromsGetDoc - PromsGetDoc - v4.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/PromsGetDoc/PROMSGETDOC/PromsGetDoc.sln b/PROMS/PromsGetDoc/PROMSGETDOC/PromsGetDoc.sln deleted file mode 100644 index d387d948..00000000 --- a/PROMS/PromsGetDoc/PROMSGETDOC/PromsGetDoc.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PromsGetDoc", "PromsGetDoc.csproj", "{97C3A741-3C26-453D-9F2F-F083CB62B45C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {97C3A741-3C26-453D-9F2F-F083CB62B45C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97C3A741-3C26-453D-9F2F-F083CB62B45C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97C3A741-3C26-453D-9F2F-F083CB62B45C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97C3A741-3C26-453D-9F2F-F083CB62B45C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal