diff options
Diffstat (limited to 'Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Financeiro/FornecedorMap.cs')
| -rw-r--r-- | Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Financeiro/FornecedorMap.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Financeiro/FornecedorMap.cs b/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Financeiro/FornecedorMap.cs new file mode 100644 index 0000000..431c4a8 --- /dev/null +++ b/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Financeiro/FornecedorMap.cs @@ -0,0 +1,42 @@ +using FluentNHibernate.Mapping;
+using Gestor.Infrastructure.Entities.Financeiro;
+using Gestor.Infrastructure.Entities.Generic;
+using System;
+using System.Linq.Expressions;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Infrastructure.Mappings.Financeiro
+{
+ public class FornecedorMap : ClassMap<FornecedorDb>
+ {
+ public FornecedorMap()
+ {
+ base.Table("fornecedor");
+ base.LazyLoad();
+ base.Id((FornecedorDb x) => (object)x.Id).GeneratedBy.Identity().Column("idfornecedor");
+ base.Map((FornecedorDb x) => (object)x.IdEmpresa).Column("idempresa").Not.Nullable();
+ base.Map((FornecedorDb x) => (object)x.IdCentro).Column("idcentro");
+ base.Map((FornecedorDb x) => (object)x.IdConta).Column("idconta");
+ base.Map((FornecedorDb x) => (object)x.IdPlano).Column("idcplanos");
+ base.Map((FornecedorDb x) => (object)x.TipoPagamento).CustomType<TipoPagamento>().Column("idtipopagto");
+ base.Map((FornecedorDb x) => x.Nome).Column("nome");
+ base.Map((FornecedorDb x) => x.Documento).Column("cpfcnpj");
+ base.Map((FornecedorDb x) => x.Cep).Column("cep");
+ base.Map((FornecedorDb x) => x.Cidade).Column("cidade");
+ base.Map((FornecedorDb x) => x.Estado).Column("uf");
+ base.Map((FornecedorDb x) => x.Bairro).Column("bairro");
+ base.Map((FornecedorDb x) => x.Endereco).Column("endereco");
+ base.Map((FornecedorDb x) => x.Numero).Column("numero");
+ base.Map((FornecedorDb x) => x.Complemento).Column("complemento");
+ base.Map((FornecedorDb x) => (object)x.TipoTelefone1).CustomType<TipoTelefone>().Column("idfonetipo1");
+ base.Map((FornecedorDb x) => x.Prefixo1).Column("ddd1");
+ base.Map((FornecedorDb x) => x.Telefone1).Column("fone1");
+ base.Map((FornecedorDb x) => (object)x.TipoTelefone2).CustomType<TipoTelefone>().Column("idfonetipo2");
+ base.Map((FornecedorDb x) => x.Prefixo2).Column("ddd2");
+ base.Map((FornecedorDb x) => x.Telefone2).Column("fone2");
+ base.Map((FornecedorDb x) => (object)x.Ativo).Column("Ativo");
+ base.Map((FornecedorDb x) => x.Email).Column("email");
+ base.Map((FornecedorDb x) => x.Observacao).CustomType("StringClob").CustomSqlType("varchar(MAX)");
+ }
+ }
+}
\ No newline at end of file |