From f86465ff714308da448c5a0842043883acf0f267 Mon Sep 17 00:00:00 2001 From: Taarly Date: Mon, 30 Jun 2025 16:54:33 +0200 Subject: [PATCH] ADDED another error message and fixed the height of my new entry window. and added input sanitization for new entries --- Project.Controller/InputSanitizer.cs | 19 +++++++ .../EntryErrorPopup/EntryErrorPopup.axaml | 57 +++++++++++++++++++ .../EntryErrorPopup/EntryErrorPopup.axaml.cs | 22 +++++++ Project.View/NewEntry/NewEntry.axaml.cs | 28 +++++++-- Project.View/PopUp/PopUp.axaml | 3 +- Project.View/Project.View.csproj | 4 ++ 6 files changed, 126 insertions(+), 7 deletions(-) create mode 100644 Project.View/EntryErrorPopup/EntryErrorPopup.axaml create mode 100644 Project.View/EntryErrorPopup/EntryErrorPopup.axaml.cs diff --git a/Project.Controller/InputSanitizer.cs b/Project.Controller/InputSanitizer.cs index 17b0aa1..abd71ef 100644 --- a/Project.Controller/InputSanitizer.cs +++ b/Project.Controller/InputSanitizer.cs @@ -21,4 +21,23 @@ public partial class InputSanitizer if (string.IsNullOrEmpty(username) || username.Length < 4) return false; else return true; } + + //NewEntry - Name Check + public static bool EntryName(string name) + { + if (string.IsNullOrEmpty(name)) return false; + else return true; + } + //NewEntry - user/mailcheck + public static bool Userormail(string usermail) + { + if (string.IsNullOrEmpty(usermail)) return false; + else return true; + } + //NewEntry - password check + public static bool Password(string pass) + { + if (string.IsNullOrEmpty(pass) || pass.Length < 6) return false; + else return true; + } } \ No newline at end of file diff --git a/Project.View/EntryErrorPopup/EntryErrorPopup.axaml b/Project.View/EntryErrorPopup/EntryErrorPopup.axaml new file mode 100644 index 0000000..06ac2a4 --- /dev/null +++ b/Project.View/EntryErrorPopup/EntryErrorPopup.axaml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +