From 0440c722a221b8068bbf388c1c0c51f0faff0451 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 14:17:46 -0300 Subject: some dlls --- .../Gestor.Model.Domain.Ferramentas/Trilha.cs | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Gestor.Model/Gestor.Model.Domain.Ferramentas/Trilha.cs (limited to 'Gestor.Model/Gestor.Model.Domain.Ferramentas/Trilha.cs') diff --git a/Gestor.Model/Gestor.Model.Domain.Ferramentas/Trilha.cs b/Gestor.Model/Gestor.Model.Domain.Ferramentas/Trilha.cs new file mode 100644 index 0000000..f627dc5 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Ferramentas/Trilha.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Gestor.Model.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Gestor.Model.Validation; +using Newtonsoft.Json; + +namespace Gestor.Model.Domain.Ferramentas; + +public class Trilha : DomainBase, IDomain +{ + public string Titulo { get; set; } + + public string Descricao { get; set; } + + public List Fases { get; set; } + + public bool Ativo { get; set; } + + public TipoTrilha Tipo { get; set; } + + [JsonIgnore] + public Func>> ValidationEvent => Validate; + + public List> Validate() + { + List> list = ValidationHelper.AddValue(); + if (string.IsNullOrWhiteSpace(Titulo)) + { + list.AddValue("Titulo", Messages.Obrigatorio); + } + if (Fases == null || Fases.Count == 0) + { + list.AddValue("Fases", Messages.Obrigatorio); + } + return list; + } + + public List Log() + { + List list = new List(); + list.Add(new TupleList + { + Tuples = new ObservableCollection> + { + new Tuple("TÍTULO DA TRILHA", string.IsNullOrWhiteSpace(Titulo) ? "" : Titulo, ""), + new Tuple("DESCRIÇÃO DA TRILHA", string.IsNullOrWhiteSpace(Descricao) ? "" : Descricao, ""), + new Tuple("ATIVO", Ativo ? "SIM" : "NÃO", "") + } + }); + ObservableCollection> observableCollection = new ObservableCollection> + { + new Tuple("FASES$", "", "") + }; + if (Fases != null) + { + foreach (Fase fase in Fases) + { + observableCollection.Add(new Tuple($" FASE {Fases.IndexOf(fase) + 1}$", "", "")); + observableCollection.Add(new Tuple(" TÍTULO DA FASE", string.IsNullOrWhiteSpace(fase.Titulo) ? "" : fase.Titulo, "")); + observableCollection.Add(new Tuple(" DESCRIÇÃO DA FASE", string.IsNullOrWhiteSpace(fase.Descricao) ? "" : fase.Descricao, "")); + foreach (Tarefa tarefa in fase.Tarefas) + { + observableCollection.Add(new Tuple($" TAREFA {fase.Tarefas.IndexOf(tarefa) + 1}$", "", "")); + observableCollection.Add(new Tuple(" TÍTULO DA TAREFA", string.IsNullOrWhiteSpace(tarefa.Titulo) ? "" : tarefa.Titulo, "")); + _ = tarefa.Agendamento; + observableCollection.Add(new Tuple(" AGENDAMENTO DA TAREFA", tarefa.Agendamento.ToShortDateString(), "")); + _ = tarefa.Agendamento; + observableCollection.Add(new Tuple(" HORA DA TAREFA", tarefa.Agendamento.ToShortTimeString(), "")); + observableCollection.Add(new Tuple(" ANOTAÇÕES DA TAREFA", string.IsNullOrWhiteSpace(tarefa.Anotacoes) ? "" : tarefa.Anotacoes, "")); + observableCollection.Add(new Tuple(" STATUS DA TAREFA", tarefa.Status.GetDescription(), "")); + } + } + list.Add(new TupleList + { + Tuples = observableCollection + }); + } + return list; + } +} -- cgit v1.2.3