Fungerande version av skiktad lösning Winforms App med SQlite och entity framework
This commit is contained in:
26
WinFormDiApp.BL/Helpers/Extensions.cs
Normal file
26
WinFormDiApp.BL/Helpers/Extensions.cs
Normal file
@ -0,0 +1,26 @@
|
||||
namespace WinFormDiApp.BL.Helpers;
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static bool IsNumeric(this string value)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
if (value.All(char.IsDigit)) return true;
|
||||
else return false;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
public static bool IsDate(this string value) {
|
||||
if (!string.IsNullOrEmpty(value) && value.Length<20)
|
||||
{
|
||||
if (DateTime.TryParse(value, out DateTime date))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
19
WinFormDiApp.BL/Models/AccountRecord.cs
Normal file
19
WinFormDiApp.BL/Models/AccountRecord.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using WinFormDiApp.BL.Models.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WinFormDiApp.BL.Models
|
||||
{
|
||||
public class AccountRecord : BaseEntity
|
||||
{
|
||||
public DateTime BetalDatum { get; set; } = DateTime.MinValue;
|
||||
public string Mottagare { get; set; } = string.Empty;
|
||||
public string Konto { get; set; } = string.Empty;
|
||||
public double Belopp { get; set; }
|
||||
public string Avisering { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
10
WinFormDiApp.BL/Models/Common/BaseEntity.cs
Normal file
10
WinFormDiApp.BL/Models/Common/BaseEntity.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace WinFormDiApp.BL.Models.Common
|
||||
{
|
||||
public abstract class BaseEntity
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
18
WinFormDiApp.BL/Models/Member.cs
Normal file
18
WinFormDiApp.BL/Models/Member.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using WinFormDiApp.BL.Models.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WinFormDiApp.BL.Models;
|
||||
|
||||
public class Member : BaseEntity
|
||||
{
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
public string NickName { get; set; } = string.Empty;
|
||||
public string PersonType { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
13
WinFormDiApp.BL/WinFormDiApp.BL.csproj
Normal file
13
WinFormDiApp.BL/WinFormDiApp.BL.csproj
Normal file
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\Enums\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user