public void ControleButton(ProductPM PM, string btnToevoegenOS, string btnToevoegenFW)
 {
     if (btnToevoegenOS == "Toevoegen")
     {
         PM.ids += PM.SelectedOS.ToString() + ";";
         PM.idsF += "";
         SplitGekozenItems(PM);
     }
     else if (btnToevoegenFW == "Toevoegen")
     {
         PM.idsF += PM.SelectedFrameWork.ToString() + ";";
         PM.ids += "";
         SplitGekozenItems(PM);
     }
     else
     {
         SplitGekozenItems(PM);
     }
 }
        public void SplitGekozenItems(ProductPM PM)
        {
            if (PM.ids == null && PM.idsF == null)
            {
                PM.GekozenFMs = new SelectList(new List<Framework>(), "FrameworkId", "Naam");
                PM.GekozenOSn = new SelectList(new List<OS>(), "OSId", "Naam");
                return;
            }
            else
            {
                string[] stukken = PM.ids.Split(';');
                PM.product.OperatingSystems = getGekozenOSn(stukken);
                PM.GekozenOSn = new SelectList(PM.product.OperatingSystems, "OSId", "Naam");

                stukken = PM.idsF.Split(';');
                PM.product.Frameworks = getGekozenFW(stukken);
                PM.GekozenFMs = new SelectList(PM.product.Frameworks, "FrameworkId", "Naam");
            }
        }
        public ProductPM GetPM(List<OS> Osn, List<Framework> Frameworks)
        {
            ProductPM PM = new ProductPM();
            SelectList GekozenOSn = new SelectList(new List<OS>(), "OSId", "Naam");
            SelectList GekozenFMs = new SelectList(new List<Framework>(), "FrameworkId", "Naam");

            PM.OSsn = getSelectListOS(Osn);
            PM.FrameWorks = getSelectListFW(Frameworks);

            PM.GekozenOSn = GekozenOSn;
            PM.GekozenFMs = GekozenOSn;
            PM.product = new Product();

            return PM;
        }
 public void SaveProduct(ProductPM PM, HttpPostedFileBase file)
 {
     PM.product.Image = file.FileName;
     repoProduct.SaveProduct(PM.product);
     WebshopCache.RefreshCash("Producten");
 }
        public void Toevoegen_test()
        {
            //Act
            ProductPM test = new ProductPM();
            ViewResult result = (ViewResult)controller.Toevoegen();
            ProductPM pm = result.Model as ProductPM;

            //Assert
            Assert.IsNotNull(pm);
            Assert.IsInstanceOfType(result.Model, typeof(ProductPM));
        }