60 lines
1.6 KiB
C#
60 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GestionDeCommerceInfoClasseBDDNCouches
|
|
{
|
|
public class Article
|
|
{
|
|
private int? id;
|
|
public int ID
|
|
{
|
|
get
|
|
{
|
|
if (id != null)
|
|
return id.Value;
|
|
else
|
|
return -1;
|
|
}
|
|
set
|
|
{
|
|
if (id == null)
|
|
id = value;
|
|
}
|
|
}
|
|
public double PrixHTVA;
|
|
public int Stock;
|
|
public bool Visible, Actif;
|
|
public string Designation;
|
|
public Article()
|
|
{
|
|
|
|
}
|
|
public Article(int id, string designation, double prixHTVA, int stock, bool visible, bool actif)
|
|
{
|
|
this.id = id; Designation = designation;
|
|
PrixHTVA = prixHTVA; Stock = stock; Visible = visible; Actif = actif;
|
|
}
|
|
public Article(string designation, double prixHTVA, int stock, bool visible, bool actif)
|
|
{
|
|
this.id = null; Designation = designation;
|
|
PrixHTVA = prixHTVA; Stock = stock; Visible = visible; Actif = actif;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return Designation;
|
|
}
|
|
public static implicit operator string(Article lSTArticle)
|
|
{
|
|
return lSTArticle.ToString();
|
|
}
|
|
/*public static explicit operator string(Article lSTArticle)
|
|
{
|
|
return lSTArticle.ToString();
|
|
}*/
|
|
}
|
|
}
|