Exemple #1
0
        public async Task OnCountyChanged(Syncfusion.Blazor.DropDowns.ChangeEventArgs <byte> args)
        {
            byte countyID = args.Value;

            SelectedCounty = CountyList.FirstOrDefault(x => x.CountyID == countyID);
            await GetData(SelectedCounty?.CountyName, CriticalDaysCount);
        }
Exemple #2
0
        /// <summary>
        /// To fetch details
        /// </summary>
        /// <param name="districtID"></param>
        /// <returns></returns>
        public CountyList GetCounty(string districtID)
        {
            OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_MST_GET_COUNTY";

            cmd             = new OracleCommand(proc, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("DISTRICTID_", districtID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr           = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            CountyBO         objcountBO   = null;
            CountyList       objcountlist = new CountyList();

            while (dr.Read())
            {
                objcountBO            = new CountyBO();
                objcountBO.CountyID   = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("COUNTYID"))));
                objcountBO.CountyName = dr.GetValue(dr.GetOrdinal("COUNTYNAME")).ToString();
                objcountlist.Add(objcountBO);
            }

            dr.Close();
            return(objcountlist);
        }
Exemple #3
0
 private CountyList GetCounties(Boolean refresh)
 {
     if (_counties.IsNull() || refresh)
     {
         _counties = GeographicManagerTest.GetAllCounties();
     }
     return(_counties);
 }
Exemple #4
0
        public async Task GetAllHospitalRawData()
        {
            var allCountiesRawData = new Dictionary <string, string>();

            foreach (var county in CountyList.Where(county => !allCountiesRawData.ContainsKey(county.CountyName)))
            {
                string countyRawData = await CovidDataService.GetCARawCovidHospitalJsonDataByCounty(county.CountyName);

                allCountiesRawData.Add(county.CountyName, countyRawData);
            }

            await DownloadZip(allCountiesRawData, "Hospital_Data", "CAOpenData_Hospital_All_Counties");
        }
Exemple #5
0
        /// <summary>
        /// To fetch details
        /// </summary>
        /// <param name="districtID"></param>
        /// <returns></returns>
        public CountyList GetAllCounties(int districtID)
        {
            CountyList objCountyList = null;

            using (cnn = new OracleConnection(connStr))
            {
                using (cmd = new OracleCommand("USP_MST_GET_COUNTY_ALL", cnn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.Add("DistrictIDIN", districtID);
                    cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
                    cmd.Connection.Open();

                    OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

                    CountyBO objCountyBO = null;
                    objCountyList = new CountyList();

                    while (dr.Read())
                    {
                        objCountyBO = new CountyBO();
                        if (!dr.IsDBNull(dr.GetOrdinal("COUNTYID")))
                        {
                            objCountyBO.CountyID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("COUNTYID")));
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("COUNTYNAME")))
                        {
                            objCountyBO.CountyName = dr.GetValue(dr.GetOrdinal("COUNTYNAME")).ToString();
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED")))
                        {
                            objCountyBO.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED"));
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("districtname")))
                        {
                            objCountyBO.DistrictName = dr.GetString(dr.GetOrdinal("districtname"));
                        }
                        // if (!dr.IsDBNull(dr.GetOrdinal("districtid"))) objCountyBO.DistrictID =Convert.ToInt32( dr.GetString(dr.GetOrdinal("districtid")));
                        objCountyList.Add(objCountyBO);
                    }

                    dr.Close();
                }
            }

            return(objCountyList);
        }
Exemple #6
0
        public void SquareBracketOperator()
        {
            Int32      countyIndex;
            CountyList newCountyList, oldCountyList;

            oldCountyList = GetCounties(true);
            newCountyList = new CountyList();
            for (countyIndex = 0; countyIndex < oldCountyList.Count; countyIndex++)
            {
                newCountyList.Add(oldCountyList[oldCountyList.Count - countyIndex - 1]);
            }
            for (countyIndex = 0; countyIndex < oldCountyList.Count; countyIndex++)
            {
                Assert.AreEqual(newCountyList[countyIndex], oldCountyList[oldCountyList.Count - countyIndex - 1]);
            }
        }
Exemple #7
0
        protected override async Task OnInitializedAsync()
        {
            string countyName = "San Bernardino";

            CountyList = await CovidDataService.GetCountyList();

            SelectedCounty = CountyList.FirstOrDefault(x => x.CountyName == countyName);
            DefaultCounty  = SelectedCounty?.CountyID ?? 0;

            CriticalDayList = await GetCriticalDayList();

            DefaultCriticalDaysCount = AppConfigurationSettings.CriticalDaysCount == 0 ? 7 : AppConfigurationSettings.CriticalDaysCount;
            CriticalDaysCount        = DefaultCriticalDaysCount;

            await GetCriticalDaysMessage(CriticalDaysCount);
        }
        public ActionResult Index()
        {
            string filterAsString = Request.QueryString["incidentFilter"];
            WeatherIncidentType?filter;

            try
            {
                filter = (WeatherIncidentType)Enum.Parse(typeof(WeatherIncidentType), filterAsString);
            }
            catch (ArgumentException)
            {
                filter = null;
            }

            double radius;

            if (!double.TryParse(Request.QueryString["radius"], out radius))
            {
                radius = 15;
            }

            County mainCounty = CountyList.GetCounty(Request.QueryString["county"], new State(Request.QueryString["state"]));

            List <County> counties = new List <County> {
                mainCounty
            };

            counties.AddRange(CountyList.FindNearbyCounties(mainCounty.Geocode, radius));
            counties = counties.Distinct().ToList();

            var ncdc = new Ncdc();
            List <WeatherIncident> ncdcIncidents = new List <WeatherIncident>();

            foreach (var county in counties)
            {
                ncdcIncidents.AddRange(ncdc.GetEvents(
                                           county.State,
                                           county.Name,
                                           DateTime.Parse(Request.QueryString["startDate"]),
                                           DateTime.Parse(Request.QueryString["endDate"]), filter));
            }

            return(Json(ncdcIncidents.Distinct(), JsonRequestBehavior.AllowGet));
        }
Exemple #9
0
        /// <summary>
        /// To get details
        /// </summary>
        /// <param name="County"></param>
        /// <returns></returns>

        public CountyList GetCounties(string County)
        {
            OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_MST_SER_COUNTY";

            cmd             = new OracleCommand(proc, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("COUNTYNAME_", County);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr           = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            CountyBO         objcountBO   = null;
            CountyList       objcountlist = new CountyList();

            while (dr.Read())
            {
                objcountBO = new CountyBO();
                if (!dr.IsDBNull(dr.GetOrdinal("COUNTYID")))
                {
                    objcountBO.CountyID = dr.GetInt32(dr.GetOrdinal("COUNTYID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("DISTRICTID")))
                {
                    objcountBO.DistrictID = dr.GetInt32(dr.GetOrdinal("DISTRICTID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("COUNTYNAME")))
                {
                    objcountBO.CountyName = dr.GetString(dr.GetOrdinal("COUNTYNAME"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED")))
                {
                    objcountBO.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("districtname")))
                {
                    objcountBO.DistrictName = dr.GetString(dr.GetOrdinal("districtname"));
                }
                objcountlist.Add(objcountBO);
            }

            dr.Close();
            return(objcountlist);
        }
Exemple #10
0
        public CountyList LoadCountyData(string pDstrictId)
        {
            cnn = new OracleConnection(AppConfiguration.ConnectionString);
            string proc = "USP_MST_GET_COUNTY";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@DistrictIDIN", pDstrictId);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr       = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            CountyBO         obMaster = null;
            CountyList       Master   = new CountyList();

            while (dr.Read())
            {
                obMaster            = new CountyBO();
                obMaster.CountyID   = dr.GetInt32(dr.GetOrdinal("COUNTYID"));
                obMaster.CountyName = dr.GetString(dr.GetOrdinal("COUNTYNAME"));
                Master.Add(obMaster);
            }
            dr.Close();
            return(Master);
        }
Exemple #11
0
        public async Task GetChapterData(int countyId, int countyId2, string chapter)
        {
            ChapterData.Clear();
            ChapterDataReversed.Clear();

            if (!ChapterList.ContainsKey(chapter) || countyId < 1)
            {
                return;
            }

            ValueColumnCaption = string.Format("{0} {1}", UnitOfMeasureList[chapter], CountyAbbreviations[CountyList.First(x => x.Value == countyId).Key]);

            var data = await CountyDetailsProvider.GetData(countyId, ChapterList[chapter]);

            if (countyId2 >= 1 && countyId != countyId2)
            {
                var data2 = await CountyDetailsProvider.GetData(countyId2, ChapterList[chapter]);

                foreach (var item2 in data2)
                {
                    var item = data.FirstOrDefault(x => x.Year == item2.Year && x.YearFraction == item2.YearFraction);
                    if (item != null)
                    {
                        item.Value2 = item2.Value;
                    }
                }

                Value2ColumnCaption = string.Format("{0} {1}", UnitOfMeasureList[chapter], CountyAbbreviations[CountyList.First(x => x.Value == countyId2).Key]);

                Value2ColumnVisibility = true;
            }
            else
            {
                Value2ColumnVisibility = false;
            }

            foreach (var item in data)
            {
                ChapterData.Add(item);
                ChapterDataReversed.Insert(0, item);
            }
        }
Exemple #12
0
 public CountyListTest()
 {
     _counties = null;
 }