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); }
/// <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); }
private CountyList GetCounties(Boolean refresh) { if (_counties.IsNull() || refresh) { _counties = GeographicManagerTest.GetAllCounties(); } return(_counties); }
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"); }
/// <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); }
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]); } }
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)); }
/// <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); }
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); }
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); } }
public CountyListTest() { _counties = null; }