Article.cs 871 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. namespace AppliWebANA.Models {
  6. public class Article {
  7. public static readonly Dictionary<Guid, Article> Stock;
  8. static Article() {
  9. Stock = new Dictionary<Guid, Article>();
  10. Article a;
  11. a = new Article() { Nom = "Chaussures de sécurité basiques", Prix = 156.5m, Quantite = 100 };
  12. Stock.Add( a.Id, a );
  13. a = new Article() { Nom = "Chaussures de sécurité renforcées et traitées anti-odeur", Prix = 459.95m, Quantite = 10 };
  14. Stock.Add( a.Id, a );
  15. a = new Article() { Nom = "Écan 72'' 16/10 Ultra 4k", Prix = 89574.99m, Quantite = 2 };
  16. Stock.Add( a.Id, a );
  17. }
  18. public Guid Id { get; set; }
  19. public string Nom { get; set; }
  20. public decimal Prix { get; set; }
  21. public int Quantite { get; set; }
  22. public Article() {
  23. Id = Guid.NewGuid();
  24. }
  25. }
  26. }