Beispiel #1
0
        protected override DBEntity getDBEntity(MySql.Data.MySqlClient.MySqlDataReader reader)
        {
            Titration Titration = new Titration(this.expert);

            Titration.id = (int)reader[this.ST_ID];
            Titration.id_especialista = (int)reader[Titration.ST.ST_ID_ESPECIALISTA];
            Titration.titulacao       = (string)reader[Titration.ST.ST_TITULACAO];
            Titration.especialidade   = (string)reader[Titration.ST.ST_ESPECIALIDADE];
            Titration.concluido       = (string)reader[Titration.ST.ST_CONCLUIDO];
            return(Titration);
        }
Beispiel #2
0
        private void BT_access_Click(object sender, EventArgs e)
        {
            if (CB_AreaAtuacao.Text != "" && CB_intimityMath.Text != "" && CB_intimityUncertain.Text != "" && CB_email.Text != "")
            {
                access.expert = access.getExpert(CB_email.Text);
                try{
                    if (access.expert != null)
                    {
                        access.expert.isNew = false;
                    }
                    else
                    {
                        List <TBCursos> tbCucrsoList = new List <TBCursos>();
                        tbCucrsoList.Add(tbCursosTecnico);
                        tbCucrsoList.Add(tbCursosGraduação);
                        tbCucrsoList.Add(tbCursosEspecialidade);
                        tbCucrsoList.Add(tbCursosMestrado);
                        tbCucrsoList.Add(tbCursosDoutorado);

                        access.expert = new Expert(CB_email.Text);
                        access.expert.expertiseField      = CB_AreaAtuacao.Text;
                        access.expert.intimityMath        = int.Parse(CB_intimityMath.Text);
                        access.expert.intimityUncertainty = Convert.ToInt16(CB_intimityUncertain.Text);
                        access.expert.isNew = true;

                        for (int i = 0; i < 2; i++)
                        {
                            TabPage   tp        = CB_concluido_mestrado.TabPages[i];
                            Titration titration = new Titration(access.expert);
                            titration.titulacao     = tp.Text;
                            titration.especialidade = ((RBPublicPrivate)tp.Controls[0]).returnDecision();
                            access.dbTitrations.Add(titration);
                        }
                        int k = 0;
                        for (int i = 2; i < 7; i++) //adiciona os valores da lista de combobox no segundo for
                        {
                            TabPage  tp  = CB_concluido_mestrado.TabPages[i];
                            TBCursos tbc = tbCucrsoList[i - 2];
                            ComboBox cb  = tbc.returnCombo();

                            for (int j = 0; j < cb.Items.Count; j++)
                            {
                                Titration titration = new Titration(access.expert);
                                titration.titulacao = tp.Text;
                                string[] splitCurso = cb.Items[j].ToString().Split(new char[] { ';' });
                                titration.especialidade = splitCurso[0];
                                if (splitCurso[1] == "False")
                                {
                                    titration.concluido = "0";
                                }
                                access.dbTitrations.Add(titration);
                            }
                            k++;
                        }
                    }

                    int
                        trainingMethodId    = int.Parse(((ComboBoxItem)CB_MetodoTreinamento.Items[CB_MetodoTreinamento.SelectedIndex]).Value),
                        elicitationMethodId = int.Parse(((ComboBoxItem)CB_MetodoEducao.Items[CB_MetodoEducao.SelectedIndex]).Value);

                    string
                        trainingMethodName    = CB_MetodoTreinamento.Text,
                        elicitationMethodName = CB_MetodoEducao.Text;

                    Method
                        trainingMethod    = new Method(trainingMethodId),
                        elicitationMethod = new Method(elicitationMethodId);

                    access.project         = access.getProject(CB_project.Text);
                    access.analyst         = access.getAnalyst(CB_analista.Text);
                    access.process         = new Process(access.expert, access.project, trainingMethod, elicitationMethod);
                    access.process.analyst = access.analyst;
                }
                catch (Exception exc)
                {
                    iformPrincipal.DisplayMessage(exc.StackTrace, true);
                }

                access.project.addExpert(access.expert);
                new TimeEvent(null, TimeEvent.EventType.ACCESS_EXPERT, access.process);
                this.iformPrincipal.startMethod(this.access.process);
                this.Close();
                //ActiveForm.Close();

                /*//codigo paleativo para pegar o id dos metodos sem criar função no interfacebanco
                 * if (cb_metodoeducao.text == "firmino") idmetodoeducao = 1;
                 * if (cb_metodoeducao.text == "direto") idmetodoeducao = 2;
                 * if (cb_metodoeducao.text == "bisseção") idmetodoeducao = 3;
                 * if (cb_metodotreinamento.text == "firmino") idmetodotreinamento = 1;
                 * if (cb_metodotreinamento.text == "direto") idmetodotreinamento = 2;
                 * if (cb_metodotreinamento.text == "bisseção") idmetodotreinamento = 3;*/
                //

                /*//if(CB_AreaAtuacao.Text != "" && CB_intimityMath.Text != "" && CB_intimityUncertain.Text != "" && CB_email.Text != ""){
                 * //    InterfaceBanco banco =  InterfaceBanco.getInstance();
                 * //    banco.InserirEspecialsita(Convert.ToInt16(CB_intimityMath.Text),
                 * //        Convert.ToInt16(CB_intimityUncertain.Text),
                 * //        CB_AreaAtuacao.Text,CB_email.Text,CB_analista.Text,idMetodoTreinamento,idMetodoEducao);
                 *
                 * //    //for (int i = 0; i < titulacao.Count; i++)
                 * //    //{
                 * //    //    banco.InserirTitulação(titulacao[i],especialidade[i]);
                 * //    //}
                 * }*/

                /*else
                 * {
                 *  iformPrincipal.DisplayMessage(DefaultConfig.ST_TXT_ALL_FIELDS_FILL, true);
                 * }
                 *
                 * this.iformPrincipal.configurarProcesso((ElicitationMethod)idMetodoTreinamento - 1, (ElicitationMethod)idMetodoEducao - 1);
                 *
                 * ActiveForm.Close();*/
            }
            else
            {
                MessageBox.Show(DefaultConfig.ST_TXT_ALL_FIELDS_FILL, "Informações incompletas!");
            }
        }