Added various

- Added DOC
- Added Patient
- Added Notifications
- Added Messages
- Various Refactoring
This commit is contained in:
2019-01-04 15:52:13 +01:00
parent e98b0ee6ce
commit 3751680fd3
23 changed files with 831 additions and 265 deletions

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace SeniorAssistant.Models
{
@@ -12,8 +9,7 @@ namespace SeniorAssistant.Models
public class MenuItem : IMenuItem
{
public MenuItem(string text) : this(text, "#") { }
public MenuItem(string text, string href)
public MenuItem(string text, string href = "#")
{
Text = text;
HRef = href;

View File

@@ -0,0 +1,26 @@
using LinqToDB.Mapping;
using System;
namespace SeniorAssistant.Models
{
public class Message : IHasTime
{
[Column(IsPrimaryKey = true, CanBeNull = false, IsIdentity = true)]
public int Id { get; set; }
[NotNull]
public DateTime Time { get; set; }
[NotNull]
public string Username { get; set; }
[NotNull]
public string Reciver { get; set; }
[NotNull]
public string Body { get; set; }
public bool Seen { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using LinqToDB.Mapping;
using System;
namespace SeniorAssistant.Models
{
public class Notification : IHasTime
{
[Column(IsPrimaryKey = true, CanBeNull = false, IsIdentity = true)]
public int Id { get; set; }
[NotNull]
public string Username { get; set; }
[NotNull]
public DateTime Time { get; set; }
public bool Seen { get; set; }
public string Message { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
using LinqToDB.Mapping;
namespace SeniorAssistant.Models.Users
{
public class Doctor : IHasUsername
{
[Column(IsPrimaryKey = true, CanBeNull = false)]
public string Username { get; set; }
[Association(ThisKey = "Username", OtherKey = nameof(User.Username), CanBeNull = false)]
public User UserData { get; set; }
public string Location { get; set; }
public string Schedule { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using LinqToDB.Mapping;
namespace SeniorAssistant.Models.Users
{
public class Patient : IHasUsername
{
[Column(IsPrimaryKey = true, CanBeNull = false)]
public string Username { get; set; }
[Association(ThisKey = "Username", OtherKey = nameof(User.Username), CanBeNull = false)]
public User UserData { get; set; }
[NotNull]
public string Doctor { get; set; }
public string Notes { get; set; }
}
}

View File

@@ -1,5 +1,4 @@
using LinqToDB.Mapping;
using Microsoft.AspNetCore.Identity;
using Newtonsoft.Json;
namespace SeniorAssistant.Models
@@ -15,10 +14,7 @@ namespace SeniorAssistant.Models
[NotNull]
[JsonIgnore]
public string Password { get; set; }
[NotNull]
public string Role { get; set; }
public string Name { get; set; }
public string LastName { get; set; }