Ejemplo n.º 1
0
        /// <summary>
        /// The ViewModel constructor.
        /// </summary>
        /// <param name="Type"></param>
        /// <param name="Classe"></param>
        /// <param name="RefArticle"></param>
        public AjouterModifierViewModel(String Type, String Classe, int Reference)
        {
            View = new AjouterModifierView(this, Classe, Type);

            if (Type.Equals("Modifier"))
            {
                if (Classe.Equals("Familles"))
                {
                    FamillesModel CurrentFamille = FamillesDao.SelectByID(Reference);
                    View.SetDescriptionFamille(CurrentFamille);
                    ReferenceVM = Reference;
                }
                else if (Classe.Equals("SousFamilles"))
                {
                    SousFamillesModel CurrentSousFamille = SousFamillesDao.SelectByID(Reference);
                    Modif = (SousFamillesDao.SelectByID(Reference)).Famille;
                    View.SetDescriptionSousFamille(CurrentSousFamille);
                    ReferenceVM = Reference;
                }
                else
                {
                    MarquesModel CurrentMarque = MarquesDao.SelectByID(Reference);
                    View.SetDescriptionMarque(CurrentMarque);
                    ReferenceVM = Reference;
                }
            }
        }