private void CB_email_MouseClick(object sender, MouseEventArgs e)
        {
            if (CB_email.Items.Count > 0)
            {
                return;
            }
            Project  project  = new Project();
            DBEntity dbExpert = new Expert(null);
            string   projName = this.CB_project.Text;
            string   linkTB   = "`projeto_especialista`";
            string   filter   = DBEntity.getJoinFilter(projName, Project.ST.ST_NAME, project, dbExpert, linkTB);

            dbExpert.setFilter(filter);
            this.access.dbExperts = dbExpert.getDataSource();
            int nExperts = this.access.dbExperts.Count;

            CB_email.Items.Clear();
            for (int i = 0; i < nExperts; i++)
            {
                if (((Expert)this.access.dbExperts[i]).id != 0)
                {
                    CB_email.Items.Add(((Expert)this.access.dbExperts[i]).email);
                }
            }
        }
        private void CB_project_MouseClick(object sender, MouseEventArgs e)
        {
            if (CB_project.Items.Count > 0)
            {
                return;
            }

            Expert  dbExpert  = new Expert(null);
            Project dbProject = new Project();
            string  email     = this.CB_email.Text;
            string  linkTB    = "`projeto_especialista`";
            string  filter    = DBEntity.getJoinFilter(email, Expert.ST.ST_EMAIL, dbExpert, dbProject, linkTB);

            dbProject.setFilter(filter);
            this.access.dbProjects = (List <DBEntity>)dbProject.getDataSource();
            int nProj = this.access.dbProjects.Count;

            CB_project.Items.Clear();
            for (int i = 0; i < nProj; i++)
            {
                if (((Project)this.access.dbProjects[i]).name != "NULL")
                {
                    CB_project.Items.Add(((Project)this.access.dbProjects[i]).name);
                }
            }
        }
示例#3
0
 public Link_ExpertProject(Project project, Expert expert)
 {
     this.ST_TB_NAME = "`projeto_especialista`";
     this.loadColumnNames();
     this.project = project;
     this.expert  = expert;
 }
 private Access()
 {
     this.expert       = null;
     this.project      = null;
     this.analyst      = null;
     this.dbTitrations = new List <DBEntity>();
 }
示例#5
0
 public void setExpert(Expert expert)
 {
     if (expert != null)
     {
         this.expert   = expert;
         this.idExpert = expert.id;
         expert.processes.Add(this);
     }
 }
示例#6
0
        //public void loadExpertsFromDB (Project project, Method trainingMethod, Method elicitationMethod, string externFilter) {
        //    DBEntity dbExpert = new Expert (trainingMethod, elicitationMethod);
        //    string linkTB = "`projeto_especialista`";
        //    string filter = dbExpert.getJoinFilter (project.name, project.ST_NAME, project, dbExpert, linkTB);
        //    filter += externFilter;
        //    dbExpert.setFilter (filter);
        //    this.experts = dbExpert.getDataSource ();//TODO: it is yet missing to append to the filter the IDs of the training and elicitation methods ...
        //}
        //public void loadQuestionsFromDB(){
        //}
        public void loadTimeEventsFromDB(Project project, Method trainingMethod, Method elicitationMethod, string externFilter)
        {
            int nExperts = this.experts.Count;

            for (int i = 0; i < nExperts; i++)
            {
                Expert expert_i = (Expert)this.experts[i];
            }
        }
示例#7
0
        //public TimeEvent timeEvent { get; set; }


        public Answer(Expert expert, Question question)
        {
            this.ST_TB_NAME = "`respostas`";
            this.ST_ID      = "idResposta";
            this.loadColumnNames();
            this.expert   = expert;
            this.question = question;
            //this.timeEvent = timeEvent;
        }
示例#8
0
 public ExperimentResult(Question question, Expert expert, string resultado)
 {
     this.ST_TB_NAME = "`resultado_experimento`";
     this.ST_ID      = "idResposta";
     this.loadColumnNames();
     this.question             = question;
     this.expert               = expert;
     this.resultado            = resultado;
     question.experimentResult = this;
 }
示例#9
0
 public Process(Expert expert, Project project, Method trainingMethod, Method elicitationMethod)
 {
     this.ST_TB_NAME = "`processos`";
     this.ST_ID      = "id_processos";
     this.loadColumnNames();
     this.project           = project;
     this.elicitationMethod = elicitationMethod;
     this.trainingMethod    = trainingMethod;
     this.setExpert(expert);
 }
示例#10
0
 public Titration(Expert expert)
 {
     this.ST_TB_NAME = "`titulacao`";
     this.ST_ID      = "idTitulacao";
     this.loadColumnNames();
     this.expert    = expert;
     this.concluido = "1";
     expert.titrations.Add(this);
     this.id_especialista = expert.id;//TODO: it must be assigned when inserting in the DB
 }
 public Alternative(Question question, Expert expert, Alternative parentAlternative)
 {
     this.ST_TB_NAME = "`alternativa_resposta`";
     this.ST_ID      = "id_alternativa_resposta";
     this.loadColumnNames();
     this.question           = question;
     this.expert             = expert;
     this.parentAlternative  = parentAlternative;
     this.isNew              = true;
     this.real_probabilidade = DefaultConfig.NULL_ID;
     this.n_filhos           = 0;
 }
示例#12
0
        override protected DBEntity getDBEntity(MySqlDataReader reader)
        {
            Expert expert = new Expert((string)reader[Expert.ST.ST_EMAIL]);

            expert.id                  = (int)reader[this.ST_ID];
            expert.intimityMath        = (int)reader[Expert.ST.ST_INTIMITY_MATH];
            expert.intimityUncertainty = (int)reader[Expert.ST.ST_INTIMITY_UNC];
            expert.expertiseField      = (string)reader[Expert.ST.ST_EXPERTISE_FIELD];
            //expert.email = (string)reader[this.ST_EMAIL];
            //expert.analyst = (string)reader[this.ST_ANALYST];
            //expert.index_lastTrainingQuestion = (int)reader[this.ST_INDEX_LAST_TRAINING_QUESTION];
            //expert.index_lastElicitationQuestion= (int)reader[this.ST_INDEX_LAST_ELICITATION_QUESTION];
            //expert.idTrainingMethod = (int)reader[this.ST_ID_TRAINING_METHOD];
            //expert.idElicitationMethod = (int)reader[this.ST_ID_ELICITATION_METHOD];
            //expert.idProject= (int)reader[this.ST_ID_PROJECT];
            return(expert);
        }
示例#13
0
 //override public void setFilter (string filter) { }
 public void addExpert(Expert expert)
 {
     this.experts.Add(expert);
     //  expert.project = this;
 }
示例#14
0
        public FormularioCadastro(IFormPrincipal iformPrincipal)
        {
            int j = 0;

            ST_P_GRAU        = Expert.ST.DEGREES[j]; j++;
            ST_S_GRAU        = Expert.ST.DEGREES[j]; j++;
            ST_CURSO_TECNICO = Expert.ST.DEGREES[j]; j++;
            ST_GRADUACAO     = Expert.ST.DEGREES[j]; j++;
            ST_ESPECIALIDADE = Expert.ST.DEGREES[j]; j++;
            ST_MESTRADO      = Expert.ST.DEGREES[j]; j++;
            ST_DOUTORADO     = Expert.ST.DEGREES[j]; j++;
            InitializeComponent();
            this.iformPrincipal = iformPrincipal;
            //InterfaceBanco banco = InterfaceBanco.getInstance();
            //analistas = banco.retornarAnalistas();
            DBEntity dbProject = new Project();

            access.dbProjects = dbProject.getDataSource();
            int nProjects = access.dbProjects.Count;

            for (int i = 1; i < nProjects; i++)
            {
                CB_project.Items.Add(((Project)access.dbProjects[i]).name);
            }

            DBEntity dbAnalyst = new Analyst();

            access.dbAnalysts = dbAnalyst.getDataSource();
            int nAnalysts = access.dbAnalysts.Count;

            for (int i = 1; i < nAnalysts; i++)
            {
                CB_analista.Items.Add(((Analyst)access.dbAnalysts[i]).name);
            }

            DBEntity dbMethod = new Method(-1);

            dbMethods = dbMethod.getDataSource();
            int nMethods = dbMethods.Count;

            for (int i = 0; i < nMethods; i++)
            {
                if ((((Method)dbMethods[i]).name) != "0")
                {
                    //CB_MetodoEducao.Items.Add (((Method)dbMethods[i]).name);
                    CB_MetodoEducao.Items.Add(new ComboBoxItem(((Method)dbMethods[i]).id.ToString(), ((Method)dbMethods[i]).name));
                    //CB_MetodoTreinamento.Items.Add (((Method)dbMethods[i]).name);
                    CB_MetodoTreinamento.Items.Add(new ComboBoxItem(((Method)dbMethods[i]).id.ToString(), ((Method)dbMethods[i]).name));
                }
            }

            DBEntity dbExpert = new Expert(null);

            this.access.dbExperts = dbExpert.getDataSource();
            int nExperts = this.access.dbExperts.Count;

            CB_email.Items.Clear();
            for (int i = 1; i < nExperts; i++)
            {
                CB_email.Items.Add(((Expert)this.access.dbExperts[i]).email);
            }
        }
示例#15
0
        public string[] retornaQueris()
        {
            string[] queris = new string[2];
            projeto      = CLB_ATS_projects.retornaSelecionados();
            analista     = CLB_ATS_analysts.retornaSelecionados();
            email        = CLB_ATS_emails.retornaSelecionados();
            areaAtuacao  = CLB_ATS_professionalProfile.retornaSelecionados();
            intimidadeM  = CLB_ATS_mathDomain.retornaSelecionados();
            intimidadeU  = CLB_ATS_uncertaintyDomain.retornaSelecionados();
            escolaridade = CLB_ATS_degree.retornaSelecionados();

            if (projeto.Count != 0 || analista.Count != 0 || email.Count != 0 || areaAtuacao.Count != 0 ||
                intimidadeM.Count != 0 || intimidadeU.Count != 0)
            {
                this.queryAccuracy  += " where ";
                this.queryEficience += " where ";

                for (int i = 0; i < projeto.Count; i++)
                {
                    if (i == 0)
                    {
                        queryAccuracy  += "(";
                        queryEficience += "(";
                    }
                    Project proj_i = (Project)this.access.dbProjects[Convert.ToInt16(projeto[i])];
                    queryAccuracy  += "prj.nome = " + "'" + proj_i.name + "'" + " or ";
                    queryEficience += "prj.nome = " + "'" + proj_i.name + "'" + " or ";
                }
                if (projeto.Count != 0)
                {
                    queryAccuracy  = corrigeQuery(queryAccuracy);
                    queryEficience = corrigeQuery(queryEficience);
                    //queryAccuracy += ")";
                    //queryEficience += ")";
                }
                for (int i = 0; i < analista.Count; i++)
                {
                    if (i == 0)
                    {
                        queryAccuracy  += "(";
                        queryEficience += "(";
                    }
                    Analyst ana_i = (Analyst)this.access.dbAnalysts[Convert.ToInt16(analista[i])];
                    this.queryAccuracy  += "a.nomeAnalista = " + "'" + ana_i.name + "'" + " or ";
                    this.queryEficience += "a.nomeAnalista = " + "'" + ana_i.name + "'" + " or ";
                }
                if (analista.Count != 0)
                {
                    queryAccuracy  = corrigeQuery(queryAccuracy);
                    queryEficience = corrigeQuery(queryEficience);
                    //queryAccuracy += ")";
                    //queryEficience += ")";
                }

                for (int x = 0; x < access.dbExperts.Count; x++)  // esse for aqui está removendo o especialista nulo
                {
                    if (this.access.dbExperts[x].id == 0)
                    {
                        this.access.dbExperts.RemoveAt(x);
                    }
                }

                for (int i = 0; i < email.Count; i++)
                {
                    if (i == 0)
                    {
                        queryAccuracy  += "(";
                        queryEficience += "(";
                    }
                    Expert exp_i = (Expert)this.access.dbExperts[Convert.ToInt16(email[i]) - 1];
                    this.queryAccuracy  += "e.email = " + "'" + exp_i.email + "'" + " or ";
                    this.queryEficience += "e.email = " + "'" + exp_i.email + "'" + " or ";
                }
                if (email.Count != 0)
                {
                    queryAccuracy  = corrigeQuery(queryAccuracy);
                    queryEficience = corrigeQuery(queryEficience);
                    //queryAccuracy += ")";
                    //queryEficience += ")";
                }

                for (int i = 0; i < escolaridade.Count; i++)
                {
                    if (i == 0)
                    {
                        queryAccuracy  += "(";
                        queryEficience += "(";
                    }
                    this.queryAccuracy  += "t.titulacao = " + "'" + Expert.ST.DEGREES[Convert.ToInt16(escolaridade[i]) - 1] + "'" + " or ";
                    this.queryEficience += "t.titulacao = " + "'" + Expert.ST.DEGREES[Convert.ToInt16(escolaridade[i]) - 1] + "'" + " or ";
                }
                if (escolaridade.Count != 0)
                {
                    queryAccuracy  = corrigeQuery(queryAccuracy);
                    queryEficience = corrigeQuery(queryEficience);
                    //queryAccuracy += ")";
                    //queryEficience += ")";
                }
                for (int i = 0; i < areaAtuacao.Count; i++)
                {
                    if (i == 0)
                    {
                        queryAccuracy  += "(";
                        queryEficience += "(";
                    }
                    this.queryAccuracy  += "e.areaDeAtuacao = " + "'" + Expert.ST.PROFESSINOAL_PROFILES[Convert.ToInt16(areaAtuacao[i]) - 1] + "'" + " or ";
                    this.queryEficience += "e.areaDeAtuacao = " + "'" + Expert.ST.PROFESSINOAL_PROFILES[Convert.ToInt16(areaAtuacao[i]) - 1] + "'" + " or ";
                }
                if (areaAtuacao.Count != 0)
                {
                    queryAccuracy  = corrigeQuery(queryAccuracy);
                    queryEficience = corrigeQuery(queryEficience);
                    //queryAccuracy += ")";
                    //queryEficience += ")";
                }
                for (int i = 0; i < intimidadeM.Count; i++)
                {//essa conversão é para pegra o elemento zero(0) das intimidadesM e U
                    if (i == 0)
                    {
                        queryAccuracy  += "(";
                        queryEficience += "(";
                    }
                    this.queryAccuracy  += "e.intimityMath = " + Convert.ToString(Convert.ToInt16(intimidadeM[i]) - 1) + " or ";
                    this.queryEficience += "e.intimityMath = " + Convert.ToString(Convert.ToInt16(intimidadeM[i]) - 1) + " or ";
                }
                if (intimidadeM.Count != 0)
                {
                    queryAccuracy  = corrigeQuery(queryAccuracy);
                    queryEficience = corrigeQuery(queryEficience);
                    //queryAccuracy += ")";
                    //queryEficience += ")";
                }
                for (int i = 0; i < intimidadeU.Count; i++)
                {
                    if (i == 0)
                    {
                        queryAccuracy  += "(";
                        queryEficience += "(";
                    }
                    this.queryAccuracy  += "e.intimityUncertainty = " + Convert.ToString(Convert.ToInt16(intimidadeU[i]) - 1) + " or ";
                    this.queryEficience += "e.intimityUncertainty = " + Convert.ToString(Convert.ToInt16(intimidadeU[i]) - 1) + " or ";
                }
                if (intimidadeU.Count != 0)
                {
                    queryAccuracy  = corrigeQuery(queryAccuracy);
                    queryEficience = corrigeQuery(queryEficience);
                    //queryAccuracy += ")";
                    //queryEficience += ")";
                }

                this.queryAccuracy   = this.queryAccuracy.Substring(0, queryAccuracy.Length - 5);//retirar o " and " que fica no fim de cada query
                this.queryEficience  = this.queryEficience.Substring(0, queryEficience.Length - 5);
                this.queryAccuracy  += " group by estatisticas.id_estatisticas order by estatisticas.id_processos, estatisticas.id_estatisticas";
                this.queryEficience += " group by time_events.id_time order by time_events.id_processos, time_events.id_time";
            }
            queris[0] = this.queryAccuracy;
            queris[1] = this.queryEficience;
            return(queris);
        }
示例#16
0
        public Filter(IFormPrincipal iFPrincipal)
        {
            this.iFPrincipal             = iFPrincipal;
            this.tempo                   = new List <double>();
            this.id_question             = new List <int>();
            this.nome_arquivo_accuracy   = "../../accuracy.txt";
            this.nome_arquivo_efficiency = "../../efficiency.txt";
            this.queryAccuracy           = "select * from estatisticas inner join processos p"
                                           + " on p.id_processos = estatisticas.id_processos"
                                           + " inner join projeto prj on prj.id_projeto = p.id_projeto"
                                           + " inner join analistas a on a.id_analistas = p.id_analistas"
                                           + " inner join especialistas e on e.id_especialista = p.id_especialista"
                                           + " inner join titulacao t on t.id_especialista = e.id_especialista";
            //+"where e.id_especialista = 1 and prj.id_projeto = 1 and a.id_analistas = 1 and t.titulacao = 'Mestrado'";
            this.queryEficience = "select * from time_events inner join processos p"
                                  + " on p.id_processos = time_events.id_processos"
                                  + " inner join projeto prj on prj.id_projeto = p.id_projeto"
                                  + " inner join analistas a on a.id_analistas = p.id_analistas"
                                  + " inner join especialistas e on e.id_especialista = p.id_especialista"
                                  + " inner join titulacao t on t.id_especialista = e.id_especialista";
            //+ "where e.id_especialista = 1 and prj.id_projeto = 1 and a.id_analistas = 1 and t.titulacao = 'Mestrado'";
            InitializeComponent();
            LB_filter.Text = queryAccuracy + "\n" + queryEficience;
            DBEntity dbProject = new Project();

            this.access.dbProjects = dbProject.getDataSource();
            int length = this.access.dbProjects.Count;

            for (int i = 1; i < length; i++)
            {
                Project proj_i = (Project)this.access.dbProjects[i];
                this.CLB_ATS_projects.addItem(proj_i.name);
            }

            DBEntity dbExpert = new Expert(null);

            this.access.dbExperts = dbExpert.getDataSource();
            length = this.access.dbExperts.Count;
            for (int i = 0; i < length; i++)
            {
                Expert exp_i = (Expert)this.access.dbExperts[i];
                if (exp_i.email != "NULL")//não pegar o especialista nulo
                {
                    this.CLB_ATS_emails.addItem(exp_i.email);
                }
            }

            this.CLB_ATS_professionalProfile.addItems(Expert.ST.PROFESSINOAL_PROFILES);
            this.CLB_ATS_mathDomain.addItems(Expert.ST.SCALE_0_10);
            this.CLB_ATS_uncertaintyDomain.addItems(Expert.ST.SCALE_0_10);
            this.CLB_ATS_degree.addItems(Expert.ST.DEGREES);

            DBEntity dbAnalista = new Analyst();

            this.access.dbAnalysts = dbAnalista.getDataSource();
            for (int i = 1; i < this.access.dbAnalysts.Count; i++)
            {
                Analyst ana_i = (Analyst)this.access.dbAnalysts[i];
                this.CLB_ATS_analysts.addItem(ana_i.name);
            }
        }