Skip to content

Commit 59e53d1

Browse files
committed
init
1 parent 5268fe9 commit 59e53d1

5 files changed

Lines changed: 28 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Este archivo .gitignore ha sido creado automáticamente por Microsoft(R) Visual Studio.
33
################################################################################
44

5+
.vs/
56
/.vs/ServQLTerminal
67
/ServQLTerminal/obj
78
/ServQLTerminal/bin

.vs/ServQL Terminal/v16/.suo

512 Bytes
Binary file not shown.

.vs/slnx.sqlite

0 Bytes
Binary file not shown.

ServQLTerminal/Program.cs

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3-
using SQLiteCLIENT;
3+
using ServQLClient;
44

55
namespace ServQLTerminal
66
{
@@ -53,9 +53,18 @@ static void Main(string[] args)
5353

5454
String username = string.Empty;
5555
string password = string.Empty;
56+
bool repeat = true;
5657
while (!client.isLoged)
5758
{
58-
connection.Open();
59+
try
60+
{
61+
62+
connection.Open();
63+
}catch (Exception e)
64+
{
65+
Console.WriteLine("Error connecting ");
66+
System.Environment.Exit(1);
67+
}
5968
Console.Write("Username: ");
6069
username = Console.ReadLine();
6170
Console.Write("Password: ");
@@ -72,7 +81,7 @@ static void Main(string[] args)
7281
string command;
7382
string cArgs;
7483
string[] commandSplited;
75-
Client.Package.Response response;
84+
Package.Response response;
7685
string prefix = "";
7786
while (true)
7887
{
@@ -82,6 +91,10 @@ static void Main(string[] args)
8291
{
8392
prefix = "exec";
8493
}
94+
else if (command == "clear")
95+
{
96+
Console.Clear();
97+
}
8598
else if(command == "exit")
8699
{
87100
if (prefix == "") break;
@@ -103,10 +116,18 @@ static void Main(string[] args)
103116
command = prefix;
104117
}
105118
response = client.sendCommand(command,cArgs);
106-
if (response?.Result == "ERROR" || response == null) Console.WriteLine("ERROR");
119+
if (response?.Result == "ERROR" || response == null) Console.WriteLine($"ERROR:{response.Message}");
107120
else
108121
{
109-
foreach (string data in response.Data) Console.WriteLine(data);
122+
foreach (string[] data in response.Data)
123+
{
124+
foreach(string d in data)
125+
{
126+
127+
Console.Write(d + " , ");
128+
}
129+
Console.WriteLine();
130+
}
110131
}
111132

112133
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<_LastSelectedProfileId>C:\Users\alber\source\repos\ServQLTerminal\ServQLTerminal\Properties\PublishProfiles\Windows.pubxml</_LastSelectedProfileId>
4+
<_LastSelectedProfileId>C:\Users\alber\source\repos\ServQL Terminal\ServQLTerminal\Properties\PublishProfiles\Windows.pubxml</_LastSelectedProfileId>
55
</PropertyGroup>
66
</Project>

0 commit comments

Comments
 (0)