コード例 #1
0
ファイル: NetaServices.svc.cs プロジェクト: ConorNeueda/NETA
        public string GetData(int value)
        {
            List<BBandPassRate> lstPassRates = new List<BBandPassRate>();

            using (NetaDBEntities neta = new NetaDBEntities())
            {
                var myData = from p in neta.view_passrates_by_broadband select p;

                foreach(view_passrates_by_broadband viewItem in myData)
                {
                    BBandPassRate bbRate = Utils.CreteBBandPassRateFromDBView(viewItem);
コード例 #2
0
        public string getJsonData()
        {
            string json;
            using (NetaDBEntities m = new NetaDBEntities())
            {
                var jsonData = from p in m.counties select p;

                JavaScriptSerializer serializer = new JavaScriptSerializer();
                json = serializer.Serialize(jsonData);

            }

            return json;
        }
コード例 #3
0
ファイル: NetaServices.svc.cs プロジェクト: ConorNeueda/NETA
    public List<BBandPassRate> MyView()
    {
        List<BBandPassRate> lstPassRates = new List<BBandPassRate>();

        using (NetaDBEntities neta = new NetaDBEntities())
        {
            var myData = from p in neta.view_passrates_by_broadband select p;

            foreach (view_passrates_by_broadband viewItem in myData)
            {
                BBandPassRate bbRate = Utils.CreteBBandPassRateFromDBView(viewItem);

                lstPassRates.Add(bbRate);
            }
        }
        return lstPassRates;
    }
コード例 #4
0
ファイル: NetaServices.svc.cs プロジェクト: ConorNeueda/NETA
        public average_performance_broadband[] getCountyAveragePerformanceArray()
        {
            List<average_performance_broadband> list = new List<average_performance_broadband>();
            using (NetaDBEntities db = new NetaDBEntities())
            {
                var data = (from p in db.average_performance_broadband
                            select p);

                foreach (average_performance_broadband item in data)
                {
                    average_performance_broadband viewAverage = new average_performance_broadband();
                    viewAverage.Average_Pass_of_5_GCSES = item.Average_Pass_of_5_GCSES;
                    list.Add(viewAverage);
                }
                var array = list.ToArray();
                return array;
            }
        }
コード例 #5
0
ファイル: NetaServices.svc.cs プロジェクト: ConorNeueda/NETA
        public List<average_performance_broadband> getAverages()
        {
            List<average_performance_broadband> list = new List<average_performance_broadband>();

            using (NetaDBEntities db = new NetaDBEntities())
            {   //Sould avoid using vars	
                var data = (from p in db.average_performance_broadband
                            select p);

                foreach (average_performance_broadband item in data)
                {
                    average_performance_broadband viewAverage = new average_performance_broadband();
                    viewAverage.county_id_fk = item.county_id_fk;
                    viewAverage.Average_Speed_mbps = item.Average_Speed_mbps;
                    viewAverage.Average_Pass_of_5_GCSES = item.Average_Pass_of_5_GCSES;
                    list.Add(viewAverage);
                }
                return list;
            }
        }
コード例 #6
0
ファイル: NetaServices.svc.cs プロジェクト: ConorNeueda/NETA
        public List<AuthorityPop_SyncSpeed> getUptakeByAuthority()
        {
            List<AuthorityPop_SyncSpeed> list = new List<AuthorityPop_SyncSpeed>();

            using (NetaDBEntities neta = new NetaDBEntities())
            {
                var myData = (from p in neta.la_pop_speed_ranked
                              select p);

                foreach (la_pop_speed_ranked item in myData)
                {
                    AuthorityPop_SyncSpeed apss = Utils.CreateUptakeFromTable(item);

                    list.Add(apss);
                }
            }
            return list;
        }
コード例 #7
0
ファイル: NetaServices.svc.cs プロジェクト: ConorNeueda/NETA
        public decimal GetAuthoritySpeed_EmploymentCorrelation()
        {
            int id = 4;
            decimal correlation;

            using (NetaDBEntities neta = new NetaDBEntities())
            {
                var getCorrelation = (from p in neta.spearmans_ranks
                                      where p.correlation_id == id
                                      select p.spearmans_rho).First();

                correlation = getCorrelation;
            }
            return correlation;
        }
コード例 #8
0
ファイル: NetaServices.svc.cs プロジェクト: ConorNeueda/NETA
        public decimal GetCountyAveragePerformance_BroadbandCorrelation()
        {
            int id = 1;
            decimal correlation;
            using (NetaDBEntities neta = new NetaDBEntities())
            {
                var getCorrelation = (from p in neta.spearmans_ranks
                                      where p.correlation_id == id
                                      select p.spearmans_rho).First();

                correlation = getCorrelation;
            }
            return correlation;
        }
コード例 #9
0
ファイル: NetaServices.svc.cs プロジェクト: ConorNeueda/NETA
        public List<SpearmansRank> CreateSpearmansRankTable()
        {
            List<SpearmansRank> list = new List<SpearmansRank>();

            using (NetaDBEntities neta = new NetaDBEntities())
            {
                var myData = (from p in neta.spearmans_ranks
                              select p);

                foreach (spearmans_ranks item in myData)
            {
                    SpearmansRank sr = Utils.CreateCorrelationsTable(item);

                    list.Add(sr);
                }
            }
            return list;
        }
コード例 #10
0
ファイル: NetaServices.svc.cs プロジェクト: ConorNeueda/NETA
        public List<AuthorityEmployment_Speed> GetAuthorityEmployment_Speed()
        {
            List<AuthorityEmployment_Speed> list = new List<AuthorityEmployment_Speed>();

            using (NetaDBEntities neta = new NetaDBEntities())
            {
                var data = (from p in neta.authority_employment_syncspeed_rankings
                            select p);

                foreach (authority_employment_syncspeed_rankings item in data)
            {
                    AuthorityEmployment_Speed aes = Utils.CreateAuthEmploymentSpeedFromTable(item);
                    list.Add(aes);
                }
            }

            return list;
            }