Example #1
0
        private void KreirajSamsung(string model)
        {
            Enum.TryParse(model, out Samsung.ModelTelefona Model);
            Samsung samsung = new Samsung(Model, comboBox3.Text);
            int     n       = dataGridView1.Rows.Add();
            Dictionary <string, string> dict = samsung.Tabela();

            dataGridView1.Rows[n].Cells[0].Value           = samsung.Proizvodjac();
            dataGridView1.Rows[n].Cells[1].Value           = Samsung.ModelToString(model);
            dataGridView1.Rows[n].Cells[2].Value           = dict.ElementAt(0).Value;
            dataGridView1.Rows[n].Cells[3].Value           = dict.ElementAt(1).Value;
            dataGridView1.Rows[n].Cells[4].Value           = dict.ElementAt(2).Value;
            dataGridView1.Rows[n].Cells[5].Value           = dict.ElementAt(3).Value;
            dataGridView1.Rows[n].Cells[6].Value           = dict.ElementAt(4).Value;
            dataGridView1.Rows[n].Cells[7].Style.BackColor = Color.FromName(dict.ElementAt(5).Value);
        }
Example #2
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.Text == "Huawei")
     {
         comboBox2.Items.Clear();
         comboBox2.Show();
         label2.Show();
         comboBox2.Items.Add(Huawei.ModelToString("P40"));
         comboBox2.Items.Add(Huawei.ModelToString("MateXs"));
         comboBox2.Items.Add(Huawei.ModelToString("Y7p"));
         comboBox2.Items.Add(Huawei.ModelToString("Enjoy10"));
     }
     else if (comboBox1.Text == "LG")
     {
         comboBox2.Items.Clear();
         comboBox2.Show();
         label2.Show();
         comboBox2.Items.Add(LG.ModelToString("Q51"));
         comboBox2.Items.Add(LG.ModelToString("W10Alpha"));
         comboBox2.Items.Add(LG.ModelToString("K61"));
         comboBox2.Items.Add(LG.ModelToString("G8XThinQ"));
     }
     else if (comboBox1.Text == "Samsung")
     {
         comboBox2.Items.Clear();
         comboBox2.Show();
         label2.Show();
         comboBox2.Items.Add(Samsung.ModelToString("S20"));
         comboBox2.Items.Add(Samsung.ModelToString("A71"));
         comboBox2.Items.Add(Samsung.ModelToString("M31"));
         comboBox2.Items.Add(Samsung.ModelToString("Note10"));
     }
     else
     {
         comboBox2.Hide();
     }
 }