Ejemplo n.º 1
0
        private void KreirajHuawei(string model)
        {
            Enum.TryParse(model, out Huawei.ModelTelefona Model);
            Huawei huawei = new Huawei(Model, comboBox3.Text);
            int    n      = dataGridView1.Rows.Add();
            Dictionary <string, string> dict = huawei.Tabela();

            dataGridView1.Rows[n].Cells[0].Value           = huawei.Proizvodjac();
            dataGridView1.Rows[n].Cells[1].Value           = Huawei.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);
        }
Ejemplo n.º 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();
     }
 }