diff --git a/Matomat/Input/KeyboardReader.cs b/Matomat/Input/KeyboardReader.cs index 9983475..2622be4 100644 --- a/Matomat/Input/KeyboardReader.cs +++ b/Matomat/Input/KeyboardReader.cs @@ -10,6 +10,10 @@ namespace Matomat.Input { public string getCodeID(string text) { + if (Console.KeyAvailable) + { + ConsoleKeyInfo k = Console.ReadKey(true); + } Factory.getLCD().print(text); string str = ""; while (true) diff --git a/Matomat/Model/User.cs b/Matomat/Model/User.cs index 0acf22b..e979ef5 100644 --- a/Matomat/Model/User.cs +++ b/Matomat/Model/User.cs @@ -60,10 +60,17 @@ namespace Matomat.Model object[] row = Factory.getDBO().getResult(); if (row == null) { - Console.WriteLine(Factory.getDBO().getError()); - return 0.0; + //Console.WriteLine(Factory.getDBO().getError()); + return 0; + } + try + { + return (double.Parse(row[0].ToString())) / 100; + } + catch (Exception) + { + return 0; } - return (double.Parse(row[0].ToString()))/100; } public bool GetAdmin()