-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProduit.cs
39 lines (35 loc) · 1.35 KB
/
Produit.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EFM_2014_V1
{
class Produit
{
private uint IdProduit;
private string NomProduit;
private float PrixProduit;
private Catégorie catégorie;
private static uint auto;
//Accesseurs
public uint _IdProduit { get { return IdProduit; } private set { IdProduit = value; } }
public string _NomProduit { get { return NomProduit; } private set { NomProduit = value; } }
public float _PrixProduit { get { return PrixProduit; } private set { PrixProduit = value; } }
public Catégorie _catégorie { get { return catégorie; } private set { catégorie = value; } }
//Constructeur d'initialisation
public Produit(string NomProduit, float PrixProduit, Catégorie catégorie)
{
auto++;
IdProduit = auto;
this.NomProduit = NomProduit;
this.PrixProduit = PrixProduit;
this.catégorie = catégorie;
}
//methode ToString
public override string ToString()
{
return "Id Produit: " + _IdProduit + "\n" + "Nom Produit: " + _NomProduit + "\n" + "Prix Produit: " + _PrixProduit + "\n" + "Catégorie: " + catégorie._NomCatégorie + "\n";
}
}
}