Example #1
0
        private void btnCauta_Click(object sender, EventArgs e)
        {
            Masina s = adminMasini.GetMasina(txtNumeVanzator.Text, txtTip.Text);

            if (s != null)
            {
                lblMesaj.Text = s.ConversieLaSir_PentruForma();
                foreach (var optiune in gpbOptiuni.Controls)
                {
                    if (optiune is CheckBox)
                    {
                        var optiuneBox = optiune as CheckBox;
                        foreach (String opt in s.ProgramOptiuni)
                        {
                            if (optiuneBox.Text.Equals(opt))
                            {
                                optiuneBox.Checked = true;
                            }
                        }
                    }
                }
            }
            else
            {
                lblMesaj.Text = "Nu s-a gasit masina";
            }
            if (txtNumeVanzator.Enabled == true && txtTip.Enabled == true)
            {
                txtNumeVanzator.Enabled = false;
                txtTip.Enabled          = false;
                //dezactivare butoane radio
                foreach (var button in gpbCulori.Controls)
                {
                    if (button is RadioButton)
                    {
                        var radioButton = button as RadioButton;
                        radioButton.Enabled = false;
                    }
                }
            }
            else
            {
                txtNumeVanzator.Enabled = true;
                txtPret.Enabled         = true;
                //activare butoane radio
                foreach (var button in gpbCulori.Controls)
                {
                    if (button is RadioButton)
                    {
                        var radioButton = button as RadioButton;
                        radioButton.Enabled = true;
                    }
                }
            }
        }
        private void btnCauta_Click(object sender, EventArgs e)
        {
            Masina s = adminMasini.GetMasina(txtNumeVanzator.Text, txtTip.Text);


            if (s != null)
            {
                lblMesaj.Text = s.ConversieLaSir_PentruForma();
            }
            else
            {
                lblMesaj.Text = "Nu s-a gasit masina";
            }
        }