Esempio n. 1
0
        public CheckModel()
        {
            Cor.Add("Caucassiano");
            Cor.Add("Preto");
            Cor.Add("Pardo");
            Cor.Add("Indigena");

            Sexo.Add("Homem");
            Sexo.Add("Mulher");

            Escolhas.Add("Inteligente");
            Escolhas.Add("Come bolacha");
            Escolhas.Add("Come biscouto");
            Escolhas.Add("Gosta de dormir");
            Escolhas.Add("Dorme até tarde");
            Escolhas.Add("Estuda muito");
            Escolhas.Add("Vai em festas");
            Escolhas.Add("Trabalha");
            Escolhas.Add("Fuma");
            Escolhas.Add("Joga");
            Escolhas.Add("Assiste Sériado");
            Escolhas.Add("Precisa de férias");
            Escolhas.Add("Humilde");
            Escolhas.Add("Orgulhoso");
            Escolhas.Add("Gosta de leitura");
        }
Esempio n. 2
0
        public void Show(ObservableCollection <mPF_Ext> lista_pessoas)
        {
            try
            {
                List <string> _sexo    = new List <string>();
                List <string> _setor   = new List <string>();
                List <string> _perfil  = new List <string>();
                List <string> _negocio = new List <string>();

                foreach (mPF_Ext at in lista_pessoas)
                {
                    switch (at.Sexo)
                    {
                    case 1:
                        _sexo.Add("FEMININO");
                        break;

                    case 2:
                        _sexo.Add("MASCULINO");
                        break;
                    }

                    _setor.Add(at.Bairro);

                    _perfil.Add(at.Perfil.PerfilString);

                    if (at.Perfil.Perfil == 1)
                    {
                        if (at.Perfil.Negocio.ToString() == "True")
                        {
                            _negocio.Add("COM NEGÓCIO");
                        }
                        else
                        {
                            _negocio.Add("SEM NEGÓCIO");
                        }
                    }
                }

                var c_sexo = from x in _sexo
                             group x by x into g
                             let count = g.Count()
                                         orderby count descending
                                         select new { Value = g.Key, Count = count };

                foreach (var x in c_sexo)
                {
                    Sexo.Add(new KeyValuePair <string, int>(x.Value, x.Count));
                }

                var c_setor = from x in _setor
                              group x by x into g
                              let count = g.Count()
                                          orderby count descending
                                          select new { Value = g.Key, Count = count };

                foreach (var x in c_setor)
                {
                    Setor.Add(new KeyValuePair <string, int>(x.Value, x.Count));
                }

                var c_negocio = from x in _negocio
                                group x by x into g
                                let count = g.Count()
                                            orderby count descending
                                            select new { Value = g.Key, Count = count };

                foreach (var x in c_negocio)
                {
                    Negocio.Add(new KeyValuePair <string, int>(x.Value, x.Count));
                }

                var c_perfil = from x in _perfil
                               group x by x into g
                               let count = g.Count()
                                           orderby count descending
                                           select new { Value = g.Key, Count = count };

                foreach (var x in c_perfil)
                {
                    Perfil.Add(new KeyValuePair <string, int>(x.Value, x.Count));
                }
            }
            catch { }
        }