private void button7_Click(object sender, EventArgs e)
        {
            //Communication skill compares to others
            var pmtCs = fractionToDouble(dataGridViewSm.Rows[0].Cells[2].Value.ToString());
            var citCs = fractionToDouble(dataGridViewSm.Rows[0].Cells[3].Value.ToString());
            var desCs = fractionToDouble(dataGridViewSm.Rows[0].Cells[4].Value.ToString());
            var maCs  = fractionToDouble(dataGridViewSm.Rows[0].Cells[5].Value.ToString());
            var csCs  = fractionToDouble(dataGridViewSm.Rows[0].Cells[6].Value.ToString());


            //Project Managment tools
            var citPmt = fractionToDouble(dataGridViewSm.Rows[1].Cells[3].Value.ToString());
            var desPmt = fractionToDouble(dataGridViewSm.Rows[1].Cells[4].Value.ToString());
            var maPmt  = fractionToDouble(dataGridViewSm.Rows[1].Cells[5].Value.ToString());
            var csPmt  = fractionToDouble(dataGridViewSm.Rows[1].Cells[6].Value.ToString());

            //Continuos integration tools
            var desCit = fractionToDouble(dataGridViewSm.Rows[2].Cells[4].Value.ToString());
            var maCit  = fractionToDouble(dataGridViewSm.Rows[2].Cells[5].Value.ToString());
            var csCit  = fractionToDouble(dataGridViewSm.Rows[2].Cells[6].Value.ToString());

            //Development enviroment setup
            var maDes = fractionToDouble(dataGridViewSm.Rows[3].Cells[5].Value.ToString());
            var csDes = fractionToDouble(dataGridViewSm.Rows[3].Cells[6].Value.ToString());

            //Motivation ability
            var csMa = fractionToDouble(dataGridViewSm.Rows[4].Cells[6].Value.ToString());

            //Método ahp para calcular o scrum master
            scrumMasterColab = Ahp.calcularAhpTeamMaster(pmtCs, citCs, desCs, maCs, csCs, citPmt, desPmt, maPmt, csPmt, desCit, maCit, csCit, maDes, csDes, csMa);

            if (productOwner.Equals(null))
            {
                DialogResult dialogCamposIns = MessageBox.Show("Não existem elementos suficientes para construir uma equipa.",
                                                               "Erro - criação de equipa", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                DialogResult dialogConfirmar = MessageBox.Show("Pesos registados com sucesso!",
                                                               "Criar - Equipa", MessageBoxButtons.OK, MessageBoxIcon.Information);

                //Altera na BD o estado equipa do colaborador
                db.alterEstadoEquipaColabBd(scrumMasterColab[0].id_colab, "1");
            }
        }
        private void button6_Click(object sender, EventArgs e)
        {
            //Communication skill compares to others
            var kbnCm = fractionToDouble(dataGridViewPo.Rows[0].Cells[2].Value.ToString());
            var kifCm = fractionToDouble(dataGridViewPo.Rows[0].Cells[3].Value.ToString());
            var eaCm  = fractionToDouble(dataGridViewPo.Rows[0].Cells[4].Value.ToString());
            var fkCm  = fractionToDouble(dataGridViewPo.Rows[0].Cells[5].Value.ToString());

            //Knowledge of business models compares to others
            var kifKbm = fractionToDouble(dataGridViewPo.Rows[1].Cells[3].Value.ToString());
            var eaKbm  = fractionToDouble(dataGridViewPo.Rows[1].Cells[4].Value.ToString());
            var fkKbm  = fractionToDouble(dataGridViewPo.Rows[1].Cells[5].Value.ToString());

            //Knowledge of industry field
            var eaKif = fractionToDouble(dataGridViewPo.Rows[2].Cells[4].Value.ToString());
            var fkKif = fractionToDouble(dataGridViewPo.Rows[2].Cells[5].Value.ToString());

            //Entrepeneur ability compares to others
            var fkea = fractionToDouble(dataGridViewPo.Rows[3].Cells[5].Value.ToString());


            //var teste = double.Parse(myvalue);
            //DialogResult dialogCamposIns = MessageBox.Show(kbnCm.ToString(),
            //      "Erro - seleção", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //Colaborador escolhido para product owner
            productOwner = Ahp.calcularAhpProductOwner(kbnCm, kifCm, eaCm, fkCm, kifKbm, eaKbm, fkKbm, eaKif, fkKif, fkea);

            if (productOwner.Equals(null))
            {
                DialogResult dialogCamposIns = MessageBox.Show("Não existem elementos suficientes para construir uma equipa.",
                                                               "Erro - criação de equipa", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                DialogResult dialogConfirmar = MessageBox.Show("Pesos registados com sucesso!",
                                                               "Criar - Equipa", MessageBoxButtons.OK, MessageBoxIcon.Information);

                //Altera na BD o estado equipa do colaborador
                db.alterEstadoEquipaColabBd(productOwner[0].id_colab, "1");
            }
        }
        private void button8_Click(object sender, EventArgs e)
        {
            //Programming language skills
            var psaPls = fractionToDouble(dataGridViewSt.Rows[0].Cells[2].Value.ToString());
            var tsPls  = fractionToDouble(dataGridViewSt.Rows[0].Cells[3].Value.ToString());
            var citPls = fractionToDouble(dataGridViewSt.Rows[0].Cells[4].Value.ToString());
            var rcPls  = fractionToDouble(dataGridViewSt.Rows[0].Cells[5].Value.ToString());
            var dkPls  = fractionToDouble(dataGridViewSt.Rows[0].Cells[6].Value.ToString());
            var bdkPls = fractionToDouble(dataGridViewSt.Rows[0].Cells[7].Value.ToString());

            //Problem solving abilities
            var tsPsa  = fractionToDouble(dataGridViewSt.Rows[1].Cells[3].Value.ToString());
            var citPsa = fractionToDouble(dataGridViewSt.Rows[1].Cells[4].Value.ToString());
            var rcPsa  = fractionToDouble(dataGridViewSt.Rows[1].Cells[5].Value.ToString());
            var dkPsa  = fractionToDouble(dataGridViewSt.Rows[1].Cells[6].Value.ToString());
            var bdkPsa = fractionToDouble(dataGridViewSt.Rows[1].Cells[7].Value.ToString());

            //Testing skillls
            var citTs = fractionToDouble(dataGridViewSt.Rows[2].Cells[4].Value.ToString());
            var rcTs  = fractionToDouble(dataGridViewSt.Rows[2].Cells[5].Value.ToString());
            var dkTs  = fractionToDouble(dataGridViewSt.Rows[2].Cells[6].Value.ToString());
            var bdkTs = fractionToDouble(dataGridViewSt.Rows[2].Cells[7].Value.ToString());

            //Continuos integration tools
            var rcCit  = fractionToDouble(dataGridViewSt.Rows[3].Cells[5].Value.ToString());
            var dkCit  = fractionToDouble(dataGridViewSt.Rows[3].Cells[6].Value.ToString());
            var bdkCit = fractionToDouble(dataGridViewSt.Rows[3].Cells[7].Value.ToString());

            //Refactoring concepts
            var dkRc  = fractionToDouble(dataGridViewSt.Rows[4].Cells[6].Value.ToString());
            var bdkRc = fractionToDouble(dataGridViewSt.Rows[4].Cells[7].Value.ToString());

            //data knowledge
            var bdkDk = fractionToDouble(dataGridViewSt.Rows[5].Cells[7].Value.ToString());

            //lista com os elementos da scrum team
            scrumTeam = Ahp.calcularAhpTeam(psaPls, tsPls, citPls, rcPls, dkPls, bdkPls, tsPsa, citPsa, rcPsa, dkPsa, bdkPsa, citTs, rcTs, dkTs, bdkTs, rcCit, dkCit, bdkCit, dkRc, bdkRc, bdkDk);

            //verifica se existe colavoradores no array
            if (scrumTeam.Equals(null))
            {
                DialogResult dialogCamposIns = MessageBox.Show("Não existem elementos suficientes para construir uma equipa.",
                                                               "Erro - criação de equipa", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                //verificar quantos elementos vão estar presentes na equipa, no máximo uma equipa vai ter 8 elementos na scrum team


                switch (scrumTeam.Length)
                {
                case 0:
                    tam = 0;
                    break;

                case 1:
                    tam = 0;
                    break;

                case 2:
                    tam = 0;
                    break;

                case 3:
                    tam = 3;
                    break;

                case 4:
                    tam = 4;
                    break;

                case 5:
                    tam = 5;
                    break;

                case 6:
                    tam = 6;
                    break;

                case 7:
                    tam = 7;
                    break;

                default:
                    tam = 8;
                    break;
                }


                //DialogResult dialogCamposIns = MessageBox.Show(tam.ToString(),
                //  "Erro - Numero de colaboradores insuficiente", MessageBoxButtons.OK, MessageBoxIcon.Error);



                for (int i = 0; i < tam; i++)
                {
                    //Altera na BD o estado equipa do colaborador
                    db.alterEstadoEquipaColabBd(scrumTeam[i].id_colab, "1");
                }
                DialogResult dialogConfirmar = MessageBox.Show("Pesos registados com sucesso!",
                                                               "Criar - Equipa", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }