Commit 4e5cf08cb83766c0f0b3bf3bdd367a33ee6d777b
1 parent
10345955
v1.25.2.0
Showing
2 changed files
with
7 additions
and
10 deletions
Show diff stats
Vrh.Log4Pro.MaintenanceConsole/Manager - SQLDataBaseManager.cs
@@ -303,10 +303,9 @@ GO | @@ -303,10 +303,9 @@ GO | ||
303 | try | 303 | try |
304 | { | 304 | { |
305 | ColorConsole.WriteLine(prefix: $" Enter the parameters for {actiontext} LastUpdated trigger.", bracket: "", text: "", f: ConsoleColor.Yellow); | 305 | ColorConsole.WriteLine(prefix: $" Enter the parameters for {actiontext} LastUpdated trigger.", bracket: "", text: "", f: ConsoleColor.Yellow); |
306 | - string formattext = (manageaction?"[-]":"")+ "[DBNAME,][SCHEMA.]TABLE[,COLUMN]"; | 306 | + string formattext = (manageaction?"[-]":"")+ "[SCHEMA.]TABLE[,COLUMN]"; |
307 | ColorConsole.WriteLine(prefix: $" Format:", bracket: "", text: formattext, f: ConsoleColor.Yellow); | 307 | ColorConsole.WriteLine(prefix: $" Format:", bracket: "", text: formattext, f: ConsoleColor.Yellow); |
308 | 308 | ||
309 | - ColorConsole.WriteLine(prefix: " ", text: "DBNAME", bracket: "", suffix: $": name of the database of the trigger; default is {sqld.DBName} (example:LearALM2)"); | ||
310 | ColorConsole.WriteLine(prefix: " ", text: "TABLE", bracket: "", suffix: $": MANDATORY name of the table of the trigger (example:ProductionPeriods)"); | 309 | ColorConsole.WriteLine(prefix: " ", text: "TABLE", bracket: "", suffix: $": MANDATORY name of the table of the trigger (example:ProductionPeriods)"); |
311 | ColorConsole.WriteLine(prefix: " ", text: "SCHEMA", bracket: "", suffix: $": name of the schema of the table and of the trigger; default dbo (example:ALM)"); | 310 | ColorConsole.WriteLine(prefix: " ", text: "SCHEMA", bracket: "", suffix: $": name of the schema of the table and of the trigger; default dbo (example:ALM)"); |
312 | ColorConsole.WriteLine(prefix: " ", text: "COLUMN", bracket: "", suffix: $": name of the column (will be created) of the trigger; default is LastUpdated (example:LastUpdated)"); | 311 | ColorConsole.WriteLine(prefix: " ", text: "COLUMN", bracket: "", suffix: $": name of the column (will be created) of the trigger; default is LastUpdated (example:LastUpdated)"); |
@@ -322,21 +321,19 @@ GO | @@ -322,21 +321,19 @@ GO | ||
322 | createtriggerparameters = createtriggerparameters.Substring(0,1) == "-" ?createtriggerparameters.Substring(1): createtriggerparameters; | 321 | createtriggerparameters = createtriggerparameters.Substring(0,1) == "-" ?createtriggerparameters.Substring(1): createtriggerparameters; |
323 | var optionList = createtriggerparameters.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); | 322 | var optionList = createtriggerparameters.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); |
324 | 323 | ||
325 | - string db = ""; | 324 | + string db = sqld.DBName; |
326 | string tablewithschema = ""; | 325 | string tablewithschema = ""; |
327 | string column = ""; | 326 | string column = ""; |
328 | if (optionList.Length == 1) { tablewithschema = optionList[0]; } | 327 | if (optionList.Length == 1) { tablewithschema = optionList[0]; } |
329 | else if (optionList.Length == 2) { tablewithschema = optionList[0]; column = optionList[1]; } | 328 | else if (optionList.Length == 2) { tablewithschema = optionList[0]; column = optionList[1]; } |
330 | - else if (optionList.Length == 3) { db = optionList[0]; tablewithschema = optionList[1]; column = optionList[2]; } | ||
331 | - else /*if (optionList.Length > 3)*/ { ColorConsole.WriteLine("ERROR! No more parameters required beside DBNAME,TABLEWITHSCHEMA and COLUMN!", ConsoleColor.Red); goto getparameters; } | 329 | + else /*if (optionList.Length > 2)*/ { ColorConsole.WriteLine("ERROR! No more parameters required beside SCHEMA, TABLE and COLUMN!", ConsoleColor.Red); goto getparameters; } |
332 | 330 | ||
333 | - if (string.IsNullOrWhiteSpace(db)) db = sqld.DBName; | ||
334 | if (string.IsNullOrWhiteSpace(column)) column = "LastUpdated"; | 331 | if (string.IsNullOrWhiteSpace(column)) column = "LastUpdated"; |
335 | 332 | ||
336 | if (string.IsNullOrWhiteSpace(db)) { ColorConsole.WriteLine("ERROR! DATABASE can not be empty!", ConsoleColor.Red); goto getparameters; } | 333 | if (string.IsNullOrWhiteSpace(db)) { ColorConsole.WriteLine("ERROR! DATABASE can not be empty!", ConsoleColor.Red); goto getparameters; } |
337 | - if (string.IsNullOrWhiteSpace(tablewithschema)) { ColorConsole.WriteLine("ERROR! TABLEWITHSCHEMA can not be empty!", ConsoleColor.Red); goto getparameters; } | 334 | + if (string.IsNullOrWhiteSpace(tablewithschema)) { ColorConsole.WriteLine("ERROR! [SCHEMA.]TABLE can not be empty!", ConsoleColor.Red); goto getparameters; } |
338 | var tablewithschemasplitted = tablewithschema.Split('.'); | 335 | var tablewithschemasplitted = tablewithschema.Split('.'); |
339 | - if (tablewithschemasplitted.Length != 1 && tablewithschemasplitted.Length != 2) { ColorConsole.WriteLine("ERROR! TABLEWITHSCHEMA incorrect!", ConsoleColor.Red); goto getparameters; } | 336 | + if (tablewithschemasplitted.Length != 1 && tablewithschemasplitted.Length != 2) { ColorConsole.WriteLine("ERROR! [SCHEMA.]TABLE incorrect!", ConsoleColor.Red); goto getparameters; } |
340 | if (string.IsNullOrWhiteSpace(column)) { ColorConsole.WriteLine("ERROR! COLUMN can not be empty!", ConsoleColor.Red); goto getparameters; } | 337 | if (string.IsNullOrWhiteSpace(column)) { ColorConsole.WriteLine("ERROR! COLUMN can not be empty!", ConsoleColor.Red); goto getparameters; } |
341 | 338 | ||
342 | string schema = "dbo"; | 339 | string schema = "dbo"; |
Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices; | @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; | ||
32 | // You can specify all the values or you can default the Build and Revision Numbers | 32 | // You can specify all the values or you can default the Build and Revision Numbers |
33 | // by using the '*' as shown below: | 33 | // by using the '*' as shown below: |
34 | // [assembly: AssemblyVersion("1.0.*")] | 34 | // [assembly: AssemblyVersion("1.0.*")] |
35 | -[assembly: AssemblyVersion("1.25.1.0")] | ||
36 | -[assembly: AssemblyFileVersion("1.25.1.0")] | 35 | +[assembly: AssemblyVersion("1.25.2.0")] |
36 | +[assembly: AssemblyFileVersion("1.25.2.0")] |