Beispiel #1
0
 public AverageSpeed_AveragePass_County(NetaDAL.average_performance_broadband apb)
 {
     Id           = apb.id;
     CountyID     = apb.county_id_fk;
     AverageSpeed = apb.Average_Speed_mbps;
     AveragePass  = apb.Average_Pass_of_5_GCSES;
 }
Beispiel #2
0
    public static AverageSpeed_AveragePass_County CreateCountyAveragesFromTable(average_performance_broadband table)
    {
        AverageSpeed_AveragePass_County ret = new AverageSpeed_AveragePass_County();

        ret.CountyID = table.county_id_fk;
        ret.AveragePass = table.Average_Pass_of_5_GCSES;
        ret.AverageSpeed = table.Average_Speed_mbps;
        ret.Id = table.id;

        return ret;
    }
Beispiel #3
0
        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;
            }
        }
Beispiel #4
0
        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;
            }
        }