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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
|
{
public class Article : INotifyPropertyChanged
{
// --- --- Attributs
private string _idarticle;
private string _reference;
private string _famille;
private string _unite;
private int _quantite;
private double _prixunitaire;
private double _remiseeuro;
public event PropertyChangedEventHandler PropertyChanged;
// --- --- Proprietes
public string idarticle
{
get { return _idarticle; }
set
{
_idarticle = value;
this.NotifyPropertyChanged("idarticle");
}
}
public string reference
{
get { return _reference; }
set
{
_reference = value;
this.NotifyPropertyChanged("reference");
}
}
public string famille
{
get { return _famille; }
set
{
_famille = value;
this.NotifyPropertyChanged("famille");
}
}
public string unite
{
get { return _unite; }
set
{
_unite = value;
this.NotifyPropertyChanged("unite");
}
}
public int quantite
{
get { return _quantite; }
set
{
_quantite = value;
this.NotifyPropertyChanged("quantite");
}
}
public double prixunitaire
{
get { return _prixunitaire; }
set
{
_prixunitaire = value;
this.NotifyPropertyChanged("prixunitaire");
}
}
public double remise
{
get { return _remiseeuro; }
set
{
_remiseeuro = value;
this.NotifyPropertyChanged("remise");
}
}
// --- --- Constructeurs
public Article(string idarticle, string reference, string famille, string unite, int quantite, double prixunitaire, double remiseeuro)
{
_idarticle = idarticle;
_reference = reference;
_famille = famille;
_unite = unite;
_quantite = quantite;
_prixunitaire = prixunitaire;
_remiseeuro = remiseeuro;
}
public static double prixTVA(double prixunitaire)
{
double prixtva = 0;
prixtva = prixunitaire * 0.2;
return Math.Round(prixtva, 2);
}
public static double remisepourcent(double prixunitaire, double remise)
{
double pourcentrem = 0;
pourcentrem = (remise * 100) / prixunitaire;
return Math.Round(pourcentrem, 2);
}
public static double prixachatnet(double prixunitaire, double tva)
{
double prixnet = 0;
prixnet = prixunitaire - tva;
return prixnet;
}
// --- --- Methodes
private void NotifyPropertyChanged(string name)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
}
} |
Partager