diff --git a/Project.Model/CreateLogin.cs b/Project.Model/CreateLogin.cs new file mode 100644 index 0000000..6f53131 --- /dev/null +++ b/Project.Model/CreateLogin.cs @@ -0,0 +1,15 @@ +namespace Project.Model; + +public class CreateLogin +{ + public string newLoginname { get; set; } + public string newMasterpassword { get; set; } + public string newEmail { get; set; } + + public CreateLogin(string username, string password, string email) + { + newLoginname = username; + newMasterpassword = password; + newEmail = email; + } +} \ No newline at end of file diff --git a/Project.Model/entry.cs b/Project.Model/Entry.cs similarity index 89% rename from Project.Model/entry.cs rename to Project.Model/Entry.cs index 5af92d3..3d7cab9 100644 --- a/Project.Model/entry.cs +++ b/Project.Model/Entry.cs @@ -1,6 +1,6 @@ namespace Project.Model; -public class entry +public class Entry { public string? entryname; public string? username; diff --git a/Project.Model/LoginCredentials.cs b/Project.Model/LoginCredentials.cs new file mode 100644 index 0000000..485405a --- /dev/null +++ b/Project.Model/LoginCredentials.cs @@ -0,0 +1,9 @@ +using System.Reflection.Metadata; + +namespace Project.Model; + +public class LoginCredentials +{ + public string? loginname { get; set; } + public string? masterpassword { get; set; } +} \ No newline at end of file diff --git a/Project.Model/logincredentials.cs b/Project.Model/logincredentials.cs deleted file mode 100644 index 76929d5..0000000 --- a/Project.Model/logincredentials.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Project.Model; - -public class loginCredentials -{ - public string? loginname; - public string? masterpassword; -} diff --git a/Project.Persistence/Class1.cs b/Project.Persistence/Class1.cs deleted file mode 100644 index d1432aa..0000000 --- a/Project.Persistence/Class1.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Project.Persistence; - -public class Class1 -{ - -} diff --git a/Project.Persistence/UserStorage.cs b/Project.Persistence/UserStorage.cs new file mode 100644 index 0000000..b516767 --- /dev/null +++ b/Project.Persistence/UserStorage.cs @@ -0,0 +1,12 @@ +using Project.Model; +namespace Project.Persistence; + +public static class UserStorage +{ + private static readonly string FilePath = "C:/Users/lowns/desktop/users.txt"; + public static void SaveUser(CreateLogin user) + { + var line = $"{user.newLoginname}:{user.newMasterpassword}:{user.newEmail}"; + File.AppendAllLines(FilePath, new[] { line }); + } +} diff --git a/Project.View/Login Page/LoginPage.axaml b/Project.View/Login Page/LoginPage.axaml index a1c44c6..7f33e9d 100644 --- a/Project.View/Login Page/LoginPage.axaml +++ b/Project.View/Login Page/LoginPage.axaml @@ -1,20 +1,46 @@ - + - - + + - + Your Login Name: - + - Password: - + Password: - - + + + + diff --git a/Project.View/Login Page/LoginPage.axaml.cs b/Project.View/Login Page/LoginPage.axaml.cs index 056324f..42557a2 100644 --- a/Project.View/Login Page/LoginPage.axaml.cs +++ b/Project.View/Login Page/LoginPage.axaml.cs @@ -17,4 +17,13 @@ public partial class LoginPage : UserControl InitializeComponent(); _controller = controller; } + private async void LoginButtonOnClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e) + { + + } + private async void NewUserButtonOnClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e) + { + var newLoginWindow = new NewLogin(); + newLoginWindow.Show(); + } } \ No newline at end of file diff --git a/Project.View/MainWindow.axaml.cs b/Project.View/MainWindow.axaml.cs index 0cbefaa..90fb8f6 100644 --- a/Project.View/MainWindow.axaml.cs +++ b/Project.View/MainWindow.axaml.cs @@ -11,6 +11,6 @@ public partial class MainWindow : Window { InitializeComponent(); _controller = new(); - MainGrid.Children.Add(new MenuView()); + MainGrid.Children.Add(new LoginPage()); } } \ No newline at end of file diff --git a/Project.View/MenuView/MenuView.axaml b/Project.View/MenuView/MenuView.axaml index a690ffc..1b4eb60 100644 --- a/Project.View/MenuView/MenuView.axaml +++ b/Project.View/MenuView/MenuView.axaml @@ -48,6 +48,11 @@ HorizontalAlignment="Left" Margin="23" Text="Name:" /> + + diff --git a/Project.View/NewEntry/NewEntry.axaml.cs b/Project.View/NewEntry/NewEntry.axaml.cs index 327d4e8..b0a5a9c 100644 --- a/Project.View/NewEntry/NewEntry.axaml.cs +++ b/Project.View/NewEntry/NewEntry.axaml.cs @@ -5,7 +5,7 @@ using Project.Controller; namespace Project.View; -public partial class NewEntry : UserControl +public partial class NewEntry : Window { readonly AppController? _controller; public NewEntry() @@ -18,4 +18,5 @@ public partial class NewEntry : UserControl InitializeComponent(); _controller = controller; } + } \ No newline at end of file diff --git a/Project.View/NewLogin/NewLogin.axaml b/Project.View/NewLogin/NewLogin.axaml new file mode 100644 index 0000000..bb81e29 --- /dev/null +++ b/Project.View/NewLogin/NewLogin.axaml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + +