summaryrefslogtreecommitdiff
path: root/Gestor.Model/Gestor.Model.Domain.Seguros/Adiantamento.cs
blob: 74375c0baf1408723d4b7464fb790fa7813ab245 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Gestor.Model.Common;
using Gestor.Model.Domain.Generic;
using Gestor.Model.Validation;

namespace Gestor.Model.Domain.Seguros;

public class Adiantamento : DomainBase
{
	private string _historico;

	public Vendedor Vendedor { get; set; }

	public TipoPagamento? TipoPagamento { get; set; }

	public string Historico
	{
		get
		{
			return _historico?.ToUpper();
		}
		set
		{
			_historico = value;
		}
	}

	public DateTime? Data { get; set; }

	public decimal Valor { get; set; }

	public bool Pago { get; set; }

	public DateTime? Pagamento { get; set; }

	public List<TupleList> Log()
	{
		List<TupleList> list = new List<TupleList>();
		TupleList tupleList = new TupleList();
		ObservableCollection<Tuple<string, string, string>> obj = new ObservableCollection<Tuple<string, string, string>>
		{
			new Tuple<string, string, string>("HISTÓRICO", string.IsNullOrWhiteSpace(Historico) ? "" : Historico, ""),
			new Tuple<string, string, string>("DATA DO ADIANTAMENTO", (!Data.HasValue) ? "" : Data?.ToShortDateString(), ""),
			new Tuple<string, string, string>("VALOR DO ADIANTAMENTO", Valor.ToString("c2"), "")
		};
		object item;
		if (TipoPagamento.HasValue)
		{
			TipoPagamento? tipoPagamento = TipoPagamento;
			item = (tipoPagamento.HasValue ? tipoPagamento.GetValueOrDefault().GetDescription() : null);
		}
		else
		{
			item = "";
		}
		obj.Add(new Tuple<string, string, string>("TIPO DO PAGAMENTO", (string)item, ""));
		obj.Add(new Tuple<string, string, string>("PAGO", Pago ? "SIM" : "NÃO", ""));
		obj.Add(new Tuple<string, string, string>("DATA DO PAGAMENTO", (!Pagamento.HasValue) ? "" : Pagamento?.ToShortDateString(), ""));
		tupleList.Tuples = obj;
		list.Add(tupleList);
		return list;
	}
}