Esempio n. 1
0
        private void btnCauta_Click(object sender, EventArgs e)
        {
            PersoaneContact s = adminPersoane.GetPersoane(txtNume.Text, txtPrenume.Text);//, txtNumarTelefon.Text, txtMail.Text);

            if (s != null)
            {
                lblInfo.Text = s.ConversieLaSir();
            }
            else
            {
                lblInfo.Text = "Nu s-a gasit Persoana de contact";
            }
            if (txtNume.Enabled == true && txtPrenume.Enabled == true)
            {
                txtNume.Enabled    = false;
                txtPrenume.Enabled = false;

                //dezactivare butoane radio
                foreach (var button in gbdGrupContact.Controls)
                {
                    if (button is RadioButton)
                    {
                        var radioButton = button as RadioButton;
                        radioButton.Enabled = false;
                    }
                }
                foreach (var ck in gpbRegiuni.Controls)
                {
                    if (ck is CheckBox)
                    {
                        var radioButton = ck as CheckBox;
                        radioButton.Enabled = false;
                    }
                }
            }
            else
            {
                txtNume.Enabled    = true;
                txtPrenume.Enabled = true;
                foreach (var button in gbdGrupContact.Controls)
                {
                    if (button is RadioButton)
                    {
                        var radioButton = button as RadioButton;
                        radioButton.Enabled = true;
                    }
                }
                foreach (var ck in gpbRegiuni.Controls)
                {
                    if (ck is CheckBox)
                    {
                        var radioButton = ck as CheckBox;
                        radioButton.Enabled = true;
                    }
                }
            }
        }
Esempio n. 2
0
        private void btnCauta_Click(object sender, EventArgs e)
        {
            PersoaneContact s = adminPersoane.GetPersoane(txtNume.Text, txtPrenume.Text);//, txtNumarTelefon.Text, txtMail.Text);

            if (s != null)
            {
                lblCauta.Text = s.ConversieLaSir();
            }
            else
            {
                lblCauta.Text = "Nu s-a gasit Persoana de contact";
            }
            if (txtNume.Enabled == true && txtPrenume.Enabled == true)
            {
                txtNume.Enabled    = false;
                txtPrenume.Enabled = false;
            }
            else
            {
                txtNume.Enabled    = true;
                txtPrenume.Enabled = true;
            }
        }
Esempio n. 3
0
        private void btnCauta_Click(object sender, EventArgs e)
        {
            PersoaneContact s = adminPersoane.GetPersoane(txtNume.Text, txtPrenume.Text);//, txtNumarTelefon.Text, txtMail.Text);
            if (s != null)
            {
                lblInfo.Text = s.ConversieLaSir();
                foreach (var genu in bpgGrupGen.Controls)
                {
                    if (genu is CheckBox)
                    {
                        var genuBox = genu as CheckBox;
                        foreach (var gen in bpgGrupGen.Controls)

                            if (gen is CheckBox)
                            {
                                var chBox = gen as CheckBox;
                                chBox.Checked = true;
                            }
                                //genuBox.Checked = true;
                    }
                }
            }
            else
                lblInfo.Text = "Nu s-a gasit Persoana de contact";
            if (txtNume.Enabled == true && txtPrenume.Enabled == true)
            {
                txtNume.Enabled = false;
                txtPrenume.Enabled = false;

            //dezactivare butoane radio
            foreach(var button in gbdGrupContact.Controls)
                {
                    if(button is RadioButton)
                    {
                        var radioButton = button as RadioButton;
                        radioButton.Enabled = false;
                    }

                }
                foreach (var genu in bpgGrupGen.Controls)
                {
                    if (genu is CheckBox)
                    {
                        var genuBox = genu as CheckBox;
                        foreach (var gen in bpgGrupGen.Controls)

                            if (gen is CheckBox)
                            {
                                var chBox = gen as CheckBox;
                                chBox.Checked = false;
                            }
                        //genuBox.Checked = true;
                    }
                }

            }
            else
            {
                txtNume.Enabled = true;
                txtPrenume.Enabled = true;
                foreach (var button in gbdGrupContact.Controls)
                {
                    if (button is RadioButton)
                    {
                        var radioButton = button as RadioButton;
                        radioButton.Enabled = true;
                    }
                }
                foreach (var chk in bpgGrupGen.Controls)
                {
                    if (chk is CheckBox)
                    {
                        var chakBox = chk as CheckBox;
                        chakBox.Enabled = true;
                    }
                }
            }
        }