From 3a4db4dd1460bf724f63fbc79dc1850497907f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Szab=C3=B3?= Date: Sat, 22 Mar 2025 14:18:25 +0100 Subject: [PATCH] =?UTF-8?q?Van=20=C3=BAj=20=C3=A9s=20folytathat=C3=B3=20Ch?= =?UTF-8?q?eckLista?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataLayer/AppDbContext.cs | 2 + .../DataLayer/Entities/CheckListHeader.cs | 26 ++++++++ .../DataLayer/Entities/CheckListRow.cs | 20 ++++++ .../Mapper/MapperProfile.cs | 5 ++ src/WorkFlowCheck.MAUI/MauiProgram.cs | 1 + .../Pages/CheckList/CheckListPage.xaml | 66 ++++++++++++++----- .../Pages/CheckList/CheckListPage.xaml.cs | 43 +++++++++++- .../Services/CheckListService.cs | 46 ++++++++++++- .../Services/Interfaces/ICheckListService.cs | 4 ++ .../Services/SyncService.cs | 45 ++++++++++++- 10 files changed, 232 insertions(+), 26 deletions(-) create mode 100644 src/WorkFlowCheck.MAUI/DataLayer/Entities/CheckListHeader.cs create mode 100644 src/WorkFlowCheck.MAUI/DataLayer/Entities/CheckListRow.cs diff --git a/src/WorkFlowCheck.MAUI/DataLayer/AppDbContext.cs b/src/WorkFlowCheck.MAUI/DataLayer/AppDbContext.cs index a411985..dc76fde 100644 --- a/src/WorkFlowCheck.MAUI/DataLayer/AppDbContext.cs +++ b/src/WorkFlowCheck.MAUI/DataLayer/AppDbContext.cs @@ -13,6 +13,8 @@ namespace WorkFlowCheck.MAUI.DataLayer { private string DbPath { get; } + public DbSet CheckListHeaders { get; set; } + public DbSet CheckListRows { get; set; } public DbSet CheckListTemplateHeaders { get; set; } public DbSet CheckListTemplateRows { get; set; } public DbSet CheckPoints { get; set; } diff --git a/src/WorkFlowCheck.MAUI/DataLayer/Entities/CheckListHeader.cs b/src/WorkFlowCheck.MAUI/DataLayer/Entities/CheckListHeader.cs new file mode 100644 index 0000000..d691c7d --- /dev/null +++ b/src/WorkFlowCheck.MAUI/DataLayer/Entities/CheckListHeader.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WorkFlowCheck.MAUI.DataLayer.Entities +{ + public class CheckListHeader + { + public int Id { get; set; } + public int CheckListTemplateHeaderId { get; set; } + public virtual CheckListTemplateHeader CheckListTemplateHeader { get; set; } + public DateTime DateExecution { get; set; } + public int UserId { get; set; } + public string ShortName { get; set; } = null!; + public string Description { get; set; } = null!; + public string DocumentNumber { get; set; } = null!; + public Guid GuidNumber { get; set; } + public bool IsStorno { get; set; } + public bool IsEditable { get; set; } + + + public virtual ICollection CheckListRows { get; set; } = new List(); + } +} diff --git a/src/WorkFlowCheck.MAUI/DataLayer/Entities/CheckListRow.cs b/src/WorkFlowCheck.MAUI/DataLayer/Entities/CheckListRow.cs new file mode 100644 index 0000000..0c8a0b6 --- /dev/null +++ b/src/WorkFlowCheck.MAUI/DataLayer/Entities/CheckListRow.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WorkFlowCheck.MAUI.DataLayer.Entities +{ + public class CheckListRow + { + public int Id { get; set; } + public int CheckListHeaderId { get; set; } + public virtual CheckListHeader CheckListHeader { get; set; } = null!; + public int CheckListTemplateRowId { get; set; } + public virtual CheckListTemplateRow CheckListTemplateRow { get; set; } = null!; + public string Answer { get; set; } = null!; + public byte[] Photo { get; set; } = null!; + public Guid GuidNumber { get; set; } + } +} diff --git a/src/WorkFlowCheck.MAUI/Mapper/MapperProfile.cs b/src/WorkFlowCheck.MAUI/Mapper/MapperProfile.cs index 97505ec..7695465 100644 --- a/src/WorkFlowCheck.MAUI/Mapper/MapperProfile.cs +++ b/src/WorkFlowCheck.MAUI/Mapper/MapperProfile.cs @@ -22,6 +22,11 @@ namespace WorkFlowCheck.MAUI.Mapper .ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRows)); CreateMap(); CreateMap(); + + CreateMap() + .ForMember(dest => dest.CheckListRowDTO, opt => opt.MapFrom(src => src.CheckListRows)); + CreateMap() + .ForMember(dest => dest.CheckListRows, opt => opt.MapFrom(src => src.CheckListRowDTO)); } } } diff --git a/src/WorkFlowCheck.MAUI/MauiProgram.cs b/src/WorkFlowCheck.MAUI/MauiProgram.cs index 320f345..07987bc 100644 --- a/src/WorkFlowCheck.MAUI/MauiProgram.cs +++ b/src/WorkFlowCheck.MAUI/MauiProgram.cs @@ -45,6 +45,7 @@ namespace WorkFlowCheck.MAUI builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); + builder.Services.AddSingleton(); builder.Services.AddTransient(); diff --git a/src/WorkFlowCheck.MAUI/Pages/CheckList/CheckListPage.xaml b/src/WorkFlowCheck.MAUI/Pages/CheckList/CheckListPage.xaml index 973be02..7561581 100644 --- a/src/WorkFlowCheck.MAUI/Pages/CheckList/CheckListPage.xaml +++ b/src/WorkFlowCheck.MAUI/Pages/CheckList/CheckListPage.xaml @@ -3,32 +3,62 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="WorkFlowCheck.MAUI.Pages.CheckList.CheckListPage" Title="Ellenőrzések"> - + + + + + +