示例#1
0
        public void setMarquesBD()
        {
            try
            {
                DataBase  db = new DataBase(dataBasePath);
                DataTable dt = db.selectQuery("SELECT * FROM Marques");
                Marque    marque;

                foreach (DataRow rows in dt.Rows)
                {
                    marque = new Marque(System.Convert.ToInt32(rows[0]), rows[1].ToString());
                    Console.WriteLine(marque.ToString());
                    this.listeMarques.Add(marque);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
示例#2
0
        public Marque getMarque(String refMarque)
        {
            //DataBase db = new DataBase(dataBasePath);
            //this.SetConnection();
            SQLiteCommand command = new SQLiteCommand("SELECT RefMarque,Nom FROM Marques WHERE RefMarque =@refMarque", this.sql_con);

            command.Parameters.AddWithValue("@refMarque", refMarque);

            Marque marque = null;

            this.sql_con.Open();
            using (SQLiteDataReader sqReader = command.ExecuteReader())
            {
                if (sqReader.Read())
                {
                    marque = new Marque(System.Convert.ToInt32(sqReader["RefMarque"]), String.Format("{0}", sqReader["Nom"]));
                }
            }
            this.sql_con.Close();
            return(marque);
        }
示例#3
0
 public Article(string RefArticle, string Description, SousFamille SousFamille, Marque Marque, float PrixHT, int Quantite)
 {
     this.Ref_Article = RefArticle;
     this.Description = Description;
     this.SousFamille = SousFamille;
     this.Marque      = Marque;
     this.PrixHT      = PrixHT;
     this.Quantite    = Quantite;
 }
示例#4
0
 public void supprimerMarque(Marque marque)
 {
     this.listeMarques.Remove(marque);
 }
示例#5
0
 public void ajouterMarque(Marque marque)
 {
     this.listeMarques.Add(marque);
 }
示例#6
0
 public Article(string refArticle, string description, SousFamille refSousFamille, Marque refMarque, double prixHT, int quantite)
 {
     this.refArticle     = refArticle;
     this.description    = description;
     this.refSousFamille = refSousFamille;
     this.refMarque      = refMarque;
     this.prixHT         = prixHT;
     this.quantite       = quantite;
 }