diff --git a/Gremlin_BlazorServer/Data/EntityClasses/Account.cs b/Gremlin_BlazorServer/Data/EntityClasses/Account.cs index bd1f1ca..d92cf39 100644 --- a/Gremlin_BlazorServer/Data/EntityClasses/Account.cs +++ b/Gremlin_BlazorServer/Data/EntityClasses/Account.cs @@ -34,8 +34,8 @@ //metadata: public DateTime DataCreationDate { get; set; } = DateTime.Now; public DateTime DataModificationDate { get; set; } = DateTime.Now; - public DateTime DataValidFrom { get; set; } - public DateTime DataValidUntil { get; set; } + public DateTime DataValidFrom { get; set; } = DateTime.Now; + public DateTime DataValidUntil { get; set; } = DateTime.MaxValue; public string? DataModificationByUser { get; set; } = "Gremlin"; public uint DataVersionNumber { get; set; } public string? DataVersionComment { get; set; } diff --git a/Gremlin_BlazorServer/Data/EntityClasses/Contact.cs b/Gremlin_BlazorServer/Data/EntityClasses/Contact.cs index e6a17c2..7620179 100644 --- a/Gremlin_BlazorServer/Data/EntityClasses/Contact.cs +++ b/Gremlin_BlazorServer/Data/EntityClasses/Contact.cs @@ -43,13 +43,13 @@ public string? SAPCompetitiveIBase { get; set; } //metadata: - public DateTime DataCreationDate { get; set; } - public DateTime DataModificationDate { get; set; } - public DateTime DataValidFrom { get; set; } - public DateTime DataValidUntil { get; set; } + public DateTime DataCreationDate { get; set; } = DateTime.Now; + public DateTime DataModificationDate { get; set; } = DateTime.Now; + public DateTime DataValidFrom { get; set; } = DateTime.Now; + public DateTime DataValidUntil { get; set; } = DateTime.MaxValue; public string? DataModificationByUser { get; set; } public uint DataVersionNumber { get; set; } public string? DataVersionComment { get; set; } - public string? DataStatus { get; set; } + public string? DataStatus { get; set; } = "Active"; } } diff --git a/Gremlin_BlazorServer/Models/AccountModel.cs b/Gremlin_BlazorServer/Models/AccountModel.cs deleted file mode 100644 index 7062390..0000000 --- a/Gremlin_BlazorServer/Models/AccountModel.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using Gremlin_BlazorServer.Data.DBClasses; -using Gremlin_BlazorServer.Data.EntityClasses; - -namespace Gremlin_BlazorServer.Models -{ - public class AccountModel : PageModel - { - private readonly GremlinContext gremlinContext; - - public AccountModel(GremlinContext context) => gremlinContext = context; - - public Account Account { get; set; } = default!; - - public async Task OnGetAsync(uint? id) - { - if (id == null || gremlinContext.Accounts == null) - { - return NotFound(); - } - - Account? account = await gremlinContext.Accounts.FirstOrDefaultAsync(account => account.AccountId == id); - if (account == null) - { - return NotFound(); - } - else - { - Account = account; - } - return Page(); - } - } -} diff --git a/Gremlin_BlazorServer/Models/ContactModel.cs b/Gremlin_BlazorServer/Models/ContactModel.cs deleted file mode 100644 index 6358fbf..0000000 --- a/Gremlin_BlazorServer/Models/ContactModel.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Gremlin_BlazorServer.Data.DBClasses; -using Gremlin_BlazorServer.Data.EntityClasses; -using Gremlin_BlazorServer.ViewModels; - -namespace Gremlin_BlazorServer.Models -{ - public class ContactModel - { - internal static async Task> GetContactViewModel() - { - GremlinContext gremlinContext = new(); - List contacts = DbHelper.GetAllContacts(gremlinContext); - return ConvertContactToContactVM(contacts); - } - - internal static ContactViewModel GetContactViewModel(string lastName) - { - GremlinContext gremlinContext = new(); - Contact contact = DbHelper.GetContact(gremlinContext, lastName); - return ConvertContactToContactVM(contact); - } - - internal static ContactViewModel GetContactViewModel(uint contactId) - { - GremlinContext gremlinContext = new(); - Contact contact = DbHelper.GetContact(gremlinContext, contactId); - return ConvertContactToContactVM(contact); - } - - public static ContactViewModel ConvertContactToContactVM(Contact contact) - { - return new(contact.ContactId, contact.AccountId, contact.LastName, contact.FirstName, contact.Gender, contact.EMail); - } - - public static List ConvertContactToContactVM(List contacts) - { - List contactsVM = new(); - - if (contacts != null) - { - foreach (Contact contact in contacts) - { - ContactViewModel contactVM = new(contact.ContactId, contact.AccountId, contact.LastName, contact.FirstName, contact.Gender, contact.EMail); - contactsVM.Add(contactVM); - } - } - return contactsVM; - } - } -} diff --git a/Gremlin_BlazorServer/Pages/AddAccount.razor b/Gremlin_BlazorServer/Pages/Accounts/Add.razor similarity index 92% rename from Gremlin_BlazorServer/Pages/AddAccount.razor rename to Gremlin_BlazorServer/Pages/Accounts/Add.razor index 45957fa..12d91ad 100644 --- a/Gremlin_BlazorServer/Pages/AddAccount.razor +++ b/Gremlin_BlazorServer/Pages/Accounts/Add.razor @@ -1,4 +1,4 @@ -@page "/AddAccount" +@page "/Accounts/Add" @using Gremlin_BlazorServer.Data.EntityClasses; @using Gremlin_BlazorServer.Services; @@ -56,9 +56,9 @@ if (await accountService.InsertAccountAsync(account)) { - navigationManager.NavigateTo("Accounts"); + navigationManager.NavigateTo("Accounts/Index"); } } - void Cancel() => navigationManager.NavigateTo("Accounts"); + void Cancel() => navigationManager.NavigateTo("Accounts/Index"); } \ No newline at end of file diff --git a/Gremlin_BlazorServer/Pages/DeleteAccount.razor b/Gremlin_BlazorServer/Pages/Accounts/Delete.razor similarity index 88% rename from Gremlin_BlazorServer/Pages/DeleteAccount.razor rename to Gremlin_BlazorServer/Pages/Accounts/Delete.razor index 6e256b7..2ddc6e4 100644 --- a/Gremlin_BlazorServer/Pages/DeleteAccount.razor +++ b/Gremlin_BlazorServer/Pages/Accounts/Delete.razor @@ -1,4 +1,4 @@ -@page "/DeleteAccount/{AccountId}" +@page "/Accounts/Delete/{AccountId}" @using Gremlin_BlazorServer.Data.EntityClasses; @using Gremlin_BlazorServer.Services; @@ -38,7 +38,7 @@
- +
@@ -54,13 +54,13 @@ { account = await Task.Run(() => accountService.GetAccountAsync(Convert.ToUInt32(AccountId))); } - protected async void DelAccount() + protected async void DeleteAccount() { await accountService.DeleteAccountAsync(account); - navigationManager.NavigateTo("Accounts"); + navigationManager.NavigateTo("Accounts/Index"); } void Cancel() { - navigationManager.NavigateTo("Accounts"); + navigationManager.NavigateTo("Accounts/Index"); } } \ No newline at end of file diff --git a/Gremlin_BlazorServer/Pages/EditAccount.razor b/Gremlin_BlazorServer/Pages/Accounts/Edit.razor similarity index 93% rename from Gremlin_BlazorServer/Pages/EditAccount.razor rename to Gremlin_BlazorServer/Pages/Accounts/Edit.razor index 0654d8f..6a62448 100644 --- a/Gremlin_BlazorServer/Pages/EditAccount.razor +++ b/Gremlin_BlazorServer/Pages/Accounts/Edit.razor @@ -1,4 +1,4 @@ -@page "/EditAccount/{AccountId}" +@page "/Accounts/Edit/{AccountId}" @using Gremlin_BlazorServer.Data.EntityClasses; @using Gremlin_BlazorServer.Services; @@ -63,8 +63,8 @@ protected async void UpdateAccount() { await accountService.UpdateAccountAsync(account); - navigationManager.NavigateTo("Accounts"); + navigationManager.NavigateTo("Accounts/Index"); } - void Cancel() => navigationManager.NavigateTo("Accounts"); + void Cancel() => navigationManager.NavigateTo("Accounts/Index"); } \ No newline at end of file diff --git a/Gremlin_BlazorServer/Pages/Accounts.razor b/Gremlin_BlazorServer/Pages/Accounts/Index.razor similarity index 90% rename from Gremlin_BlazorServer/Pages/Accounts.razor rename to Gremlin_BlazorServer/Pages/Accounts/Index.razor index 51439c4..76a7365 100644 --- a/Gremlin_BlazorServer/Pages/Accounts.razor +++ b/Gremlin_BlazorServer/Pages/Accounts/Index.razor @@ -1,4 +1,4 @@ -@page "/accounts" +@page "/Accounts/Index" @using Gremlin_BlazorServer.Data.EntityClasses; @using Gremlin_BlazorServer.Services; @@ -14,7 +14,7 @@ @onchange="SearchAccount_OnChange"/>
- + @@ -49,10 +49,10 @@ else @account.City @account.SAPAccountNumber - + - + diff --git a/Gremlin_BlazorServer/Pages/Contacts.razor b/Gremlin_BlazorServer/Pages/Contacts.razor deleted file mode 100644 index 5dd01b5..0000000 --- a/Gremlin_BlazorServer/Pages/Contacts.razor +++ /dev/null @@ -1,69 +0,0 @@ -@page "/contacts" -@using Gremlin_BlazorServer.Data.DBClasses; -@using Gremlin_BlazorServer.Models; -@using Gremlin_BlazorServer.ViewModels; - -Contacts - -

Contacts in Regulus

- -

Hier werden die Daten aus der MariaDB geladen und angezeigt.

- -
- -
- -@if (!filteredContacts.Any()) -{ -

No contacts found!

-} -else -{ -

@filteredContacts.Count contacts found!

- - - - - - - - - - - - - @foreach (ContactViewModel contact in filteredContacts) - { - - - - - - - - - } - -
ContactIDAccountIDFirstNameLastNameGenderEMail
@contact.ContactId@contact.AccountId@contact.FirstName@contact.LastName@contact.Gender@contact.EMail
-} - -@code { - public string searchContact = ""; - private List allContacts = new(); - private List filteredContacts = new(); - - protected override async Task OnInitializedAsync() - { - allContacts = await ContactModel.GetContactViewModel(); - filteredContacts = allContacts; - //allContacts = await DataAccessService.GetContactsFromDb(""); - } - - private void SearchContact_OnChange() - { - filteredContacts = allContacts.Where(c => c.LastName.ToLower().Contains(searchContact.ToLower())).ToList(); - } -} diff --git a/Gremlin_BlazorServer/Pages/Contacts/Add.razor b/Gremlin_BlazorServer/Pages/Contacts/Add.razor new file mode 100644 index 0000000..02d9f3b --- /dev/null +++ b/Gremlin_BlazorServer/Pages/Contacts/Add.razor @@ -0,0 +1,71 @@ +@page "/Contacts/Add" + +@using Gremlin_BlazorServer.Data.EntityClasses; +@using Gremlin_BlazorServer.Services; + +@inject ContactService contactService +@inject NavigationManager navigationManager + +

Add Contact

+
+ +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+ +@code { + Contact contact = new Contact(); + + protected async void CreateContact() + { + contact.DataModificationByUser = "Gremlin_BlazorServer"; + //contact.DataStatus = "Active"; + + if (await contactService.InsertContactAsync(contact)) + { + navigationManager.NavigateTo("Contacts/Index"); + } + } + + void Cancel() => navigationManager.NavigateTo("Contacts/Index"); +} \ No newline at end of file diff --git a/Gremlin_BlazorServer/Pages/Contacts/Delete.razor b/Gremlin_BlazorServer/Pages/Contacts/Delete.razor new file mode 100644 index 0000000..ee14b39 --- /dev/null +++ b/Gremlin_BlazorServer/Pages/Contacts/Delete.razor @@ -0,0 +1,74 @@ +@page "/Contacts/Delete/{ContactId}" + +@using Gremlin_BlazorServer.Data.EntityClasses; +@using Gremlin_BlazorServer.Services; + +@inject ContactService contactService +@inject NavigationManager navigationManager + +

Delete Employee

+
+

Are you sure want to delete this?

+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+ + +
+
+
+
+ +@code { + [Parameter] + public string contactId { get; set; } = default!; + Contact? contact = new Contact(); + + protected override async Task OnInitializedAsync() + { + contact = await Task.Run(() => contactService.GetContactAsync(Convert.ToUInt32(contactId))); + } + protected async void DeleteContact() + { + await contactService.DeleteContactAsync(contact); + navigationManager.NavigateTo("Contacts/Index"); + } + void Cancel() + { + navigationManager.NavigateTo("Contacts/Index"); + } +} \ No newline at end of file diff --git a/Gremlin_BlazorServer/Pages/Contacts/Edit.razor b/Gremlin_BlazorServer/Pages/Contacts/Edit.razor new file mode 100644 index 0000000..f328802 --- /dev/null +++ b/Gremlin_BlazorServer/Pages/Contacts/Edit.razor @@ -0,0 +1,76 @@ +@page "/Contacts/Edit/{ContactId}" + +@using Gremlin_BlazorServer.Data.EntityClasses; +@using Gremlin_BlazorServer.Services; + +@inject ContactService contactService +@inject NavigationManager navigationManager + +

Edit Contact

+
+ +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+ +@code { + [Parameter] + public string? contactId { get; set; } + Contact? contact = new Contact(); + + protected override async Task OnInitializedAsync() + { + contact = await Task.Run(() => contactService.GetContactAsync(Convert.ToUInt32(contactId))); + } + + protected async void UpdateContact() + { + contact.DataModificationByUser = "Gremlin_BlazorServer"; + contact.DataModificationDate = DateTime.Now; + contact.DataVersionNumber++; + await contactService.UpdateContactAsync(contact); + navigationManager.NavigateTo("Contacts/Index"); + } + + void Cancel() => navigationManager.NavigateTo("Contacts/Index"); +} \ No newline at end of file diff --git a/Gremlin_BlazorServer/Pages/Contacts/Index.razor b/Gremlin_BlazorServer/Pages/Contacts/Index.razor new file mode 100644 index 0000000..6ac1c54 --- /dev/null +++ b/Gremlin_BlazorServer/Pages/Contacts/Index.razor @@ -0,0 +1,83 @@ +@page "/Contacts/Index" + +@using Gremlin_BlazorServer.Data.EntityClasses; +@using Gremlin_BlazorServer.Services; + +@inject ContactService ContactService + +

Contacts

+ +
+ +
+ + + + + + +@if (allContacts is null) +{ +

Loading... !

+} +else +{ +

Es wurden @filteredContacts.Count Contacts gefunden.

+ @if (allContacts != null) + { + + + + + + + + + + + + + + @foreach (Contact Contact in filteredContacts) + { + + + + + + + + + } + +
@nameof(Contact.ContactId)@nameof(Contact.AccountId)@nameof(Contact.LastName)@nameof(Contact.FirstName)@nameof(Contact.Gender)@nameof(Contact.EMail)@nameof(Contact.SAPContactNumber)
@Contact.ContactId@Contact.AccountId@Contact.LastName@Contact.FirstName@Contact.Gender@Contact.EMail@Contact.SAPContactNumber + + + + + + +
+ } +} + +@code { + + public string searchContact = ""; + List allContacts = new(); + List filteredContacts = new(); + + protected override async Task OnInitializedAsync() + { + allContacts = await Task.Run(() => ContactService.GetAllContactsAsync()); + filteredContacts = allContacts; + } + + private void SearchContact_OnChange() + { + filteredContacts = allContacts.Where(a => a.LastName.ToLower().Contains(searchContact.ToLower())).ToList(); + } +} \ No newline at end of file diff --git a/Gremlin_BlazorServer/Program.cs b/Gremlin_BlazorServer/Program.cs index 3898059..97cd681 100644 --- a/Gremlin_BlazorServer/Program.cs +++ b/Gremlin_BlazorServer/Program.cs @@ -8,8 +8,10 @@ WebApplicationBuilder builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddRazorPages(); builder.Services.AddServerSideBlazor(); + builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.WebHost.UseWebRoot("wwwroot"); builder.WebHost.UseStaticWebAssets(); diff --git a/Gremlin_BlazorServer/Services/ContactService.cs b/Gremlin_BlazorServer/Services/ContactService.cs new file mode 100644 index 0000000..a3fa21f --- /dev/null +++ b/Gremlin_BlazorServer/Services/ContactService.cs @@ -0,0 +1,56 @@ +using Gremlin_BlazorServer.Data.DBClasses; +using Gremlin_BlazorServer.Data.EntityClasses; +using Microsoft.EntityFrameworkCore; +using System.Diagnostics; + +namespace Gremlin_BlazorServer.Services +{ + public class ContactService + { + private readonly GremlinContext gremlinContext; + + public ContactService(GremlinContext gC) => gremlinContext = gC; + + public void ConfigureServices(IServiceCollection services) + { + _ = services.AddDbContext(ServiceLifetime.Scoped); + } + + public async Task> GetAllContactsAsync() => await gremlinContext.Contacts.ToListAsync(); + + public async Task InsertContactAsync(Contact Contact) + { + try + { + _ = await gremlinContext.Contacts.AddAsync(Contact); + _ = await gremlinContext.SaveChangesAsync(); + return true; + } + catch (Exception exception) + { + Debug.WriteLine(exception.Message); + return false; + } + } + + public async Task GetContactAsync(uint contactId) + { + Contact? Contact = await gremlinContext.Contacts.FirstOrDefaultAsync(Contact => Contact.ContactId.Equals(contactId)); + return Contact; + } + + public async Task UpdateContactAsync(Contact contact) + { + _ = gremlinContext.Contacts.Update(contact); + _ = await gremlinContext.SaveChangesAsync(); + return true; + } + + public async Task DeleteContactAsync(Contact contact) + { + _ = gremlinContext.Remove(contact); + _ = await gremlinContext.SaveChangesAsync(); + return true; + } + } +} \ No newline at end of file diff --git a/Gremlin_BlazorServer/Shared/NavMenu.razor b/Gremlin_BlazorServer/Shared/NavMenu.razor index 133b9c0..52765f0 100644 --- a/Gremlin_BlazorServer/Shared/NavMenu.razor +++ b/Gremlin_BlazorServer/Shared/NavMenu.razor @@ -15,12 +15,12 @@
diff --git a/Gremlin_BlazorServer/Utilities/TexHandler.cs b/Gremlin_BlazorServer/Utilities/TexHandler.cs index 6152ae2..8860ad0 100644 --- a/Gremlin_BlazorServer/Utilities/TexHandler.cs +++ b/Gremlin_BlazorServer/Utilities/TexHandler.cs @@ -1,9 +1,4 @@ -using Gremlin_BlazorServer.Data.EntityClasses; -using Gremlin_BlazorServer.Models; -using Gremlin_BlazorServer.ViewModels; -using System.Text; - -namespace Gremlin_BlazorServer.Utilities +namespace Gremlin_BlazorServer.Utilities { internal class TexHandler { @@ -31,44 +26,44 @@ namespace Gremlin_BlazorServer.Utilities // } // } - public static StringBuilder CreateBriefkopf(ContactViewModel contactVM, bool tex = false) - { - StringBuilder briefkopf = new(); - - _ = contactVM.Gender == (byte)Enums.Gender.Male - ? briefkopf.AppendLine($"Herr {contactVM.FirstName} {contactVM.LastName}") - : briefkopf.AppendLine($"Frau {contactVM.FirstName} {contactVM.LastName}"); - if (tex) - { - _ = briefkopf.AppendLine($"\\\\"); - } - - //AccountViewModel accountVM = AccountModel.GetAccountViewModel(contactVM.AccountId); - - //AccountNamen mit "&" im Namen abfangen - //if (tex && accountVM.AccountName.Contains('&')) - //{ - // string[] accountNameSplit = accountVM.AccountName.Split("&"); //.Replace? - // accountVM.AccountName = ""; - // for (int i = 0; i < accountNameSplit.Length; i++) - // { - // accountVM.AccountName += i < accountNameSplit.Length - 1 - // ? accountNameSplit[i] + "\\&" - // : accountNameSplit[i]; - // } - //} - - //_ = briefkopf.AppendLine($"{accountVM.AccountName}"); - //if (tex) { _ = briefkopf.AppendLine($"\\\\"); } - - //_ = briefkopf.AppendLine($"{accountVM.AccountStreet}"); - //if (tex) { _ = briefkopf.AppendLine($"\\\\"); } - - //_ = briefkopf.AppendLine($"{accountVM.AccountZIP} {accountVM.AccountCity}"); - //if (tex) { _ = briefkopf.AppendLine($"\\\\"); } - - return briefkopf; - } + //public static StringBuilder CreateBriefkopf(ContactViewModel contactVM, bool tex = false) + //{ + // StringBuilder briefkopf = new(); + + // _ = contactVM.Gender == (byte)Enums.Gender.Male + // ? briefkopf.AppendLine($"Herr {contactVM.FirstName} {contactVM.LastName}") + // : briefkopf.AppendLine($"Frau {contactVM.FirstName} {contactVM.LastName}"); + // if (tex) + // { + // _ = briefkopf.AppendLine($"\\\\"); + // } + + // //AccountViewModel accountVM = AccountModel.GetAccountViewModel(contactVM.AccountId); + + // //AccountNamen mit "&" im Namen abfangen + // //if (tex && accountVM.AccountName.Contains('&')) + // //{ + // // string[] accountNameSplit = accountVM.AccountName.Split("&"); //.Replace? + // // accountVM.AccountName = ""; + // // for (int i = 0; i < accountNameSplit.Length; i++) + // // { + // // accountVM.AccountName += i < accountNameSplit.Length - 1 + // // ? accountNameSplit[i] + "\\&" + // // : accountNameSplit[i]; + // // } + // //} + + // //_ = briefkopf.AppendLine($"{accountVM.AccountName}"); + // //if (tex) { _ = briefkopf.AppendLine($"\\\\"); } + + // //_ = briefkopf.AppendLine($"{accountVM.AccountStreet}"); + // //if (tex) { _ = briefkopf.AppendLine($"\\\\"); } + + // //_ = briefkopf.AppendLine($"{accountVM.AccountZIP} {accountVM.AccountCity}"); + // //if (tex) { _ = briefkopf.AppendLine($"\\\\"); } + + // return briefkopf; + //} // private static StringBuilder CreateTexFile(QuoteViewModel quoteVM) // { diff --git a/Gremlin_BlazorServer/ViewModels/AccountViewModel.cs b/Gremlin_BlazorServer/ViewModels/AccountViewModel.cs deleted file mode 100644 index 0759444..0000000 --- a/Gremlin_BlazorServer/ViewModels/AccountViewModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Gremlin_BlazorServer.ViewModels -{ - public class AccountViewModel - { - public string AccountName { get; set; } - public string AccountStreet { get; set; } - public uint AccountZIP { get; set; } - public string AccountCity { get; set; } - public string AccountTypeCode { get; set; } - - public AccountViewModel(string accountName, string accountStreet, uint accountZIP, string accountCity, string accountTypeCode) - { - AccountName = accountName ?? throw new ArgumentNullException(nameof(accountName)); - AccountStreet = accountStreet ?? throw new ArgumentNullException(nameof(accountStreet)); - AccountZIP = accountZIP; - AccountCity = accountCity ?? throw new ArgumentNullException(nameof(accountCity)); - AccountTypeCode = accountTypeCode ?? throw new ArgumentNullException(nameof(accountTypeCode)); - } - } -} diff --git a/Gremlin_BlazorServer/ViewModels/ContactViewModel.cs b/Gremlin_BlazorServer/ViewModels/ContactViewModel.cs deleted file mode 100644 index 8fe0119..0000000 --- a/Gremlin_BlazorServer/ViewModels/ContactViewModel.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace Gremlin_BlazorServer.ViewModels -{ - public class ContactViewModel - { - public uint ContactId { get; set; } - public uint AccountId { get; set; } - public string LastName { get; set; } - public string FirstName { get; set; } - public byte Gender { get; set; } - public string EMail { get; set; } - - public ContactViewModel(uint contactId, uint accountId, string lastName, string firstName, byte gender, string eMail) - { - ContactId = contactId; - AccountId = accountId; - LastName = lastName ?? throw new ArgumentNullException(nameof(lastName)); - FirstName = firstName ?? throw new ArgumentNullException(nameof(firstName)); - Gender = gender; - EMail = eMail ?? throw new ArgumentNullException(nameof(eMail)); - } - - public ContactViewModel() { } - } -}