Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. SELECT
  2. [Extent1].[Codigo] AS [Codigo],
  3. [Extent1].[NomeFantasia] AS [NomeFantasia],
  4. [Extent1].[RazaoSocial] AS [RazaoSocial],
  5. [Extent1].[IE] AS [IE],
  6. [Extent1].[CNPJ] AS [CNPJ],
  7. [Extent1].[Ativo] AS [Ativo],
  8. [Extent1].[Fornecedor_Codigo] AS [Fornecedor_Codigo]
  9. FROM [dbo].[Fornecedors] AS [Extent1]
  10.  
  11. public partial class Fornecedor
  12. {
  13.  
  14. public Fornecedor()
  15. {
  16. this.Entrada = new HashSet<Entrada>();
  17. this.Produto = new HashSet<Produto>();
  18. }
  19.  
  20. [Key]
  21. public int Codigo { get; set; }
  22.  
  23. [Required(ErrorMessage="Nome fantasia é obrigatório", AllowEmptyStrings=false)]
  24. public string NomeFantasia { get; set; }
  25.  
  26. [Required(ErrorMessage = "Razão Social é obrigatório", AllowEmptyStrings = false)]
  27. public string RazaoSocial { get; set; }
  28.  
  29. [Required(ErrorMessage = "Inscrição Estadual é obrigatório", AllowEmptyStrings = false)]
  30. public string IE { get; set; }
  31.  
  32. [Required(ErrorMessage = "CNPJ é obrigatório", AllowEmptyStrings = false)]
  33. public string CNPJ { get; set; }
  34.  
  35. public Nullable<bool> Ativo { get; set; }
  36.  
  37.  
  38. public virtual ICollection<Entrada> Entrada { get; set; }
  39. public virtual ICollection<Produto> Produto { get; set; }
  40.  
  41. public virtual ICollection<Fornecedor> CollectionFornecedores { get; set; }
  42. }
  43.  
  44. public class SistemaContext : DbContext
  45. {
  46. public DbSet<Cliente> Clientes { get; set; }
  47. public DbSet<Fornecedor> Fornecedores { get; set; }
  48. }
  49.  
  50. public ActionResult Index()
  51. {
  52. return View(db.Fornecedores.Where(s => s.Ativo == true).ToList());
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement