/// <summary> /// Get all the articles in the database. /// </summary> /// <returns>A list of class <c>Articles</c>c>.</returns> public List <Articles> GetAllArticles() { Query = "SELECT * FROM Articles"; SQLiteCommand Command = new SQLiteCommand(Query, Connection); Command.ExecuteNonQuery(); var Reader = Command.ExecuteReader(); var Articles = new List <Articles>(); MarquesController MarqueController = new MarquesController(); FamillesController FamilleController = new FamillesController(); SousFamillesController SousFamilleController = new SousFamillesController(); while (Reader.Read()) { var RefArticle = Reader.GetString(0); var Description = Reader.GetString(1); var SousFamille = SousFamilleController.FindSousFamilleByRefSousFamille(Reader.GetInt32(2)); var Marque = MarqueController.FindMarqueByRefMarque(Reader.GetInt32(3)); var Prix = Reader.GetString(4); if (Prix.IndexOf(",") != -1) { Prix = Prix.Replace(",", "."); } var PrixHT = float.Parse(Prix, CultureInfo.InvariantCulture.NumberFormat); //var PrixHT = Reader.GetFloat(4); var Quantite = Reader.GetInt32(5); Articles.Add(new Articles(RefArticle, Description, FamilleController.FindFamillesByRefSousFamille(SousFamille.RefSousFamille), SousFamille, Marque, PrixHT, Quantite)); } Reader.Close(); return(Articles); }
/// <summary> /// The constructor of AddFamille. /// </summary> public AddFamille() { InitializeComponent(); this.FamilleDao = new FamillesDao(); this.MarqueController = new MarquesController(); this.FamilleController = new FamillesController(); this.SousFamilleController = new SousFamillesController(); }
/// <summary> /// The constructor of ModifyFamille. /// </summary> /// <param name="FamilleName"></param> public ModifyFamille(string FamilleName) { InitializeComponent(); this.label_Famille_Name.Text = FamilleName; this.FamilleDao = new FamillesDao(); this.MarqueController = new MarquesController(); this.FamilleController = new FamillesController(); this.SousFamilleController = new SousFamillesController(); }
/// <summary> /// The constructor of AddArticle. /// </summary> public AddArticle() { InitializeComponent(); this.ModelList = new ModelList(); this.ArticleDao = new ArticlesDao(); this.MarqueDao = new MarquesDao(); this.ArticleController = new ArticlesController(); this.MarqueController = new MarquesController(); this.FamilleController = new FamillesController(); this.SousFamilleController = new SousFamillesController(); }