SQLLite vol 1.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.MAUI.DataLayer.Entities;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.DataLayer
|
||||
{
|
||||
public class AppDbContext : DbContext
|
||||
{
|
||||
private string DbPath { get; }
|
||||
|
||||
public DbSet<CheckListTemplateHeader> CheckListTemplateHeaders { get; set; }
|
||||
public DbSet<CheckListTemplateRow> CheckListTemplateRows { get; set; }
|
||||
public DbSet<CheckPoint> CheckPoints { get; set; }
|
||||
public DbSet<Equipment> Equipments { get; set; }
|
||||
|
||||
public AppDbContext()
|
||||
{
|
||||
DbPath = Path.Combine(FileSystem.AppDataDirectory, "wfc.db");
|
||||
}
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||
{
|
||||
options.UseSqlite($"Data Source={DbPath}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class CheckListTemplateHeader
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ShortName { get; set; } = null!;
|
||||
public string Description { get; set; } = null!;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class CheckListTemplateRow
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int RowIndex { get; set; }
|
||||
public int CheckListTemplateHeaderId { get; set; }
|
||||
public virtual CheckListTemplateHeader CheckListTemplateHeader { get; set; }
|
||||
public int EquipmentId { get; set; }
|
||||
public virtual Equipment Equipment { get; set; }
|
||||
public int CheckPointId { get; set; }
|
||||
public virtual CheckPoint CheckPoint { get; set; }
|
||||
public string OperationDescription { get; set; } = null!;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class CheckPoint
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ShortName { get; set; } = null!;
|
||||
public string Code { get; set; } = null!;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class Equipment
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ShortName { get; set; } = null!;
|
||||
public string EquipmentNumber { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user