private void Cb_PlantType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            cb_Phase.Items.Clear();
            cb_Phase.SelectedIndex = -1;

            string chosen_type = cb_PlantType.SelectedItem.ToString();

            for (int i = 0; i < plants.Count; i++)
            {
                if (chosen_type == plants.GetPlantType(i))
                {
                    cb_Phase.Items.Add("Fase 1: " + plants.GetPlantPhaseOne(i) + " dage");
                    cb_Phase.Items.Add("Fase 2: " + plants.GetPlantPhaseTwo(i) + " dage");
                    cb_Phase.Items.Add("Fase 3: " + plants.GetPlantPhaseThree(i) + " dage");
                    cb_Phase.Items.Add("Fase 4: " + plants.GetPlantPhaseFour(i) + " dage");
                }
            }
        }
 public StartBatch(MainWindow mainWindow)
 {
     con             = Controller.ControllerInstance;
     this.mainWindow = mainWindow;
     InitializeComponent();
     plants = con.GetAllPlantType();
     for (int i = 0; i < plants.Count; i++)
     {
         cb_PlantType.Items.Add(plants.GetPlantType(i));
     }
 }
Example #3
0
        public void PlantTypeRepo_Can_Get_Properties_From_Item_Using_Methods()
        {
            PlantTypeRepo p = new PlantTypeRepo();

            p.AddItem(new PlantType(1, "Rose", "15", "20", "25", "20"));

            Assert.AreEqual(1, p.GetPlantId(0));
            Assert.AreEqual("Rose", p.GetPlantType(0));
            Assert.AreEqual("15", p.GetPlantPhaseOne(0));
            Assert.AreEqual("20", p.GetPlantPhaseTwo(0));
            Assert.AreEqual("25", p.GetPlantPhaseThree(0));
            Assert.AreEqual("20", p.GetPlantPhaseFour(0));
        }