/// <summary> /// Update or Create the current item with the new values and close the Update Window. /// </summary> /// <param name="RefArticle">The Reference of the Article.</param> /// <param name="Description">The Description of the Article.</param> /// <param name="Famille">The Famille of the Article.</param> /// <param name="SousFamille">The Sous Famille of the Article.</param> /// <param name="Marque">The Marque of the Article.</param> /// <param name="Quantite">The Quantite of the Article.</param> public void UpdateArticle(string RefArticle, string Description, String Famille, String SousFamille, String Marque, int Quantite) { FamillesModel FamilleObj = new FamillesModel(Famille); FamilleObj.RefFamille = FamillesDao.Contains(FamilleObj); SousFamillesModel SousFamilleObj = new SousFamillesModel(FamilleObj, SousFamille); SousFamilleObj.RefSousFamille = SousFamillesDao.Contains(SousFamilleObj); MarquesModel MarqueObj = new MarquesModel(Marque); MarqueObj.RefMarque = MarquesDao.Contains(MarqueObj); ArticlesModel Article = new ArticlesModel(RefArticle, Description, SousFamilleObj, MarqueObj, 0, Quantite); if (ArticlesDao.Contains(Article)) { ArticlesDao.Update(Article); } else { ArticlesDao.Insert(Article); } View.Close(); }