diff --git a/TIAMSharedUI/Pages/Login.razor b/TIAMSharedUI/Pages/Login.razor index 06efd79b..d3019bea 100644 --- a/TIAMSharedUI/Pages/Login.razor +++ b/TIAMSharedUI/Pages/Login.razor @@ -1,6 +1,7 @@ @page "/login" @using TIAMWebApp.Shared.Application.Interfaces; @using TIAMWebApp.Shared.Application.Models; +@using TIAMWebApp.Shared.Application.Models.PageModels; @inject NavigationManager navManager @inject IUserDataService userDataService Login @@ -12,14 +13,19 @@
Tour I Am
-
+ + + +
- + +
- + +
@@ -34,8 +40,10 @@
- Login - + + +
+

@isUserLoggedIn

@CurrentValue

Forget password? or Sign up @@ -43,6 +51,7 @@
@code { + LoginModel loginModel = new(); bool isUserLoggedIn; int CurrentValue = 0; @@ -54,6 +63,11 @@ isUserLoggedIn = user.IsLoggedIn; user.UserType = (UserType)CurrentValue; navManager.NavigateTo("home"); - + + } + + public void Submit() + { + } } diff --git a/TIAMWebApp/Server/Controllers/UserAPIController.cs b/TIAMWebApp/Server/Controllers/UserAPIController.cs new file mode 100644 index 00000000..b635c585 --- /dev/null +++ b/TIAMWebApp/Server/Controllers/UserAPIController.cs @@ -0,0 +1,53 @@ +using Microsoft.AspNetCore.Mvc; +using System.Reflection.Metadata; +using TIAMWebApp.Shared.Application.Models; + +namespace TIAMWebApp.Server.Controllers +{ + [ApiController] + [Route("[controller]")] + public class UserAPIController : ControllerBase + { + private static readonly Supplier[] suppliers = new Supplier[] + { + + new Supplier(1, "Upgen Ltd.", "Sándor Kovács", "Mr", "Váci street 132", "Budapest", "Budapest", "1136", "Hungary", "+36701234567", "+3611234567", "https://www.upgen.hu"), + new Supplier(2, "Kiraly Ltd.", "Elemér Kiraly", "Mr", "Andrássy street 37", "Budapest", "Budapest", "1066", "Hungary", "+36701234567", "+3611234567", "https://www.kiraly.hu"), + //generate 9 new suppliers with different homepage url, companyname, contactname, city, address and postalcode + new Supplier(3, "Király Ltd.", "Elemér Király", "Mr", "Andrássy street 37", "Budapest", "Budapest", "1066", "Hungary", "+36701234567", "+3611234567", "https://www.kiraly.hu"), + new Supplier(4, "Király Ltd.", "Elemér Király", "Mr", "Andrássy street 37", "Budapest", "Budapest", "1066", "Hungary", "+36701234567", "+3611234567", "https://www.kiraly.hu"), + new Supplier(5, "Király Ltd.", "Elemér Király", "Mr", "Andrássy street 37", "Budapest", "Budapest", "1066", "Hungary", "+36701234567", "+3611234567", "https://www.kiraly.hu"), + new Supplier(6, "Király Ltd.", "Elemér Király", "Mr", "Andrássy street 37", "Budapest", "Budapest", "1066", "Hungary", "+36701234567", "+3611234567", "https://www.kiraly.hu"), + new Supplier(7, "Király Ltd.", "Elemér Király", "Mr", "Andrássy street 37", "Budapest", "Budapest", "1066", "Hungary", "+36701234567", "+3611234567", "https://www.kiraly.hu"), + new Supplier(8, "Király Ltd.", "Elemér Király", "Mr", "Andrássy street 37", "Budapest", "Budapest", "1066", "Hungary", "+36701234567", "+3611234567", "https://www.kiraly.hu"), + new Supplier(9, "Király Ltd.", "Elemér Király", "Mr", "Andrássy street 37", "Budapest", "Budapest", "1066", "Hungary", "+36701234567", "+3611234567", "https://www.kiraly.hu"), + new Supplier(10, "Király Ltd.", "Elemér Király", "Mr", "Andrássy street 37", "Budapest", "Budapest", "1066", "Hungary", "+36701234567", "+3611234567", "https://www.kiraly.hu"), + new Supplier(11, "Király Ltd.", "Elemér Király", "Mr", "Andrássy street 37", "Budapest", "Budapest", "1066", "Hungary", "+36701234567", "+3611234567", "https://www.kiraly.hu"), + + }; + + private Product[] GetMockUsers(int SupplierId) + { + throw new NotImplementedException(); + } + + private static readonly User[] users = new User[] + { + new User{Id=1, Email="test@tiam.hu", IsLoggedIn = true}, + + }; + + private readonly ILogger _logger; + + public UserAPIController(ILogger logger) + { + _logger = logger; + } + + [HttpGet] + public IEnumerable GetUsers() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/TIAMWebApp/Shared/Models/PageModels/LoginModel.cs b/TIAMWebApp/Shared/Models/PageModels/LoginModel.cs new file mode 100644 index 00000000..dbe163b7 --- /dev/null +++ b/TIAMWebApp/Shared/Models/PageModels/LoginModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TIAMWebApp.Shared.Application.Models.PageModels +{ + public class LoginModel + { + [Required] + public string? Password { get; set; } + [Required] + public string? PhoneNumber { get; set; } + + } +} diff --git a/TIAMWebApp/Shared/Models/PageModels/RegistrationModel.cs b/TIAMWebApp/Shared/Models/PageModels/RegistrationModel.cs new file mode 100644 index 00000000..4cdb53a4 --- /dev/null +++ b/TIAMWebApp/Shared/Models/PageModels/RegistrationModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TIAMWebApp.Shared.Application.Models.PageModels +{ + public class RegistrationModel + { + public string? Email { get; set; } + public string? Password { get; set; } + public string? PhoneNumber { get; set; } + + } +} diff --git a/TIAMWebApp/Shared/Models/User.cs b/TIAMWebApp/Shared/Models/User.cs index 7a562a0c..fade10a2 100644 --- a/TIAMWebApp/Shared/Models/User.cs +++ b/TIAMWebApp/Shared/Models/User.cs @@ -8,6 +8,10 @@ namespace TIAMWebApp.Shared.Application.Models { public class User { + public int Id { get; set; } + public string? Email { get; set; } + public string? Password { get; set; } + public string? PhoneNumber { get; set; } public bool IsLoggedIn { get; set; } public UserType UserType { get; set; } public int UserRoles { get; set; }