protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (school_id == 0) school_id = Convert.ToInt32(Request.QueryString["schoolID"]); int school_district_id = 1; string list_html = string.Empty; list_html += "<option value=\"#\">Pick a School</option>"; if (school_district_id > 0) { var list = qOrg_School.GetSchoolsByDistrictID(school_district_id); if (list != null) { foreach (var l in list) { qOrg_School item = new qOrg_School(l.SchoolID); string curr_date = Convert.ToString(Session["CurrDate"]); if (!String.IsNullOrEmpty(Request.QueryString["currDate"])) curr_date = Request.QueryString["currDate"]; //list_html += "<option value=\"javascript:showManageElementModal(0," + item.SchoolID + ",0,'school','" + item.School + "')\">" + item.School + "</option>"; list_html += "<option value=\"javascript:openSchoolWindow('/manage/school-districts/school-default.aspx?schoolID=" + item.SchoolID + "&currDate=" + curr_date + "')\">" + item.School + "</option>"; } } } litSelector.Text = list_html; } }
protected void btnDelete_Click(object sender, EventArgs e) { school_id = Convert.ToInt32(Request.QueryString["schoolID"]); qOrg_School school = new qOrg_School(school_id); school.Available = "No"; school.MarkAsDelete = 1; school.Update(); Response.Redirect("schools-list.aspx"); }
public static qOrg_School GetSchoolBySelector(string selector) { var school = new qOrg_School(); string sql = string.Format("SchoolSelector = '{0}' AND Available = 'Yes' AND MarkAsDelete = 0", selector); school.container.Select( new DbQuery { Where = sql }); return(school); }
public static qOrg_School GetSchoolFromAutoPopulateDropdown(string school_name) { var school = new qOrg_School(); string eval = school_name; if (school_name.Contains(" - ")) { int get_dash = school_name.IndexOf(" - "); eval = school_name.Substring(0, get_dash); } school.container.Select( new DbQuery { Where = string.Format("School LIKE '%{0}%'", eval) }); return(school); }
protected static void CreateSchoolWarning(int school_id, DateTime data_date, string status, string type, string title, string text) { qOrg_School school = new qOrg_School(school_id); qHtl_HealthWarning warning = new qHtl_HealthWarning(); warning.Created = DateTime.Now; warning.CreatedBy = 0; warning.MarkAsDelete = 0; warning.DataDate = data_date.Date; warning.Type = type; warning.Title = title; warning.Text = text; warning.IssuedBy = 0; warning.IssuedTo = school.School; warning.IssuedByName = "System"; warning.Severity = "not reviewed"; string eval_status = string.Empty; if (status.ToLower().Contains("red")) eval_status = "red"; if (status.ToLower().Contains("yellow")) { if (!String.IsNullOrEmpty(eval_status)) eval_status += " "; eval_status += "yellow"; } warning.Severity = eval_status; warning.ValidFrom = DateTime.Now; warning.ReferenceID = school_id; warning.Insert(); }
public static List<SchoolData> LoadDailySchoolDataInfoList(DateTime curr_date) { var school_data = GetDailySchoolAbsenteeDataCollectionByDate(curr_date); List<SchoolData> school_list = new List<SchoolData>(); if (school_data != null) { foreach (var d in school_data) { qOrg_School school = new qOrg_School(d.SchoolID); decimal one_sigma = 0; decimal two_sigma = 0; decimal three_sigma = 0; decimal latitude = 0; decimal longitude = 0; latitude = school.Latitude; longitude = school.Longitude; one_sigma = d.HistoricRate + (1 * d.HistoricRateSTD); two_sigma = d.HistoricRate + (2 * d.HistoricRateSTD); three_sigma = d.HistoricRate + (3 * d.HistoricRateSTD); string school_color = "#C0C0C0"; if (d.A_Warning == true) school_color = "#e51400"; else if (d.B_Warning == true) school_color = "#f8a31f"; else if (d.C_Warning == true) school_color = "#ffff00"; else if (d.D_Warning == true) school_color = "#368ee0"; else if (d.E_Warning == true) school_color = "#a200ff"; else if (d.F_Warning == true) school_color = "#393"; /* else if (one_sigma > 0) { if (d.Rate > two_sigma) school_color = "#393"; } */ school_list.Add(new SchoolData() { school_id = d.SchoolID, school_name = d.School, num_days = 1, days_in_session = d.DaysInSession, total_absent = d.TotalAbsent, total_unknown = d.TotalUnknown, total_other = d.TotalOther, total_sick = d.TotalSick, gastrointestinal = d.Gastrointestinal, respiratory = d.Respiratory, rash = d.Rash, other_illness = d.OtherIllness, unknow_illness = d.UnknownIllness, total_enrolled = d.TotalEnrolled, rate = d.Rate, moving_average_absences = d.HistoricRate, rate_std = d.RateSTD, moving_rate_std = d.HistoricRateSTD, a_warning = d.A_Warning, a_warning_values = d.A_WarningValues, b_warning = d.B_Warning, b_warning_values = d.B_WarningValues, c_warning = d.C_Warning, c_warning_values = d.C_WarningValues, d_warning = d.D_Warning, d_warning_values = d.D_WarningValues, e_warning = d.E_Warning, e_warning_values = d.E_WarningValues, f_warning = d.F_Warning, f_warning_values = d.F_WarningValues, illness_status = d.IllnessStatus, gastrointestinal_status = d.GastrointestinalStatus, respiratory_status = d.RespiratoryStatus, rash_status = d.RashStatus, other_illness_status = d.OtherIllnessStatus, unknown_illness_status = d.UnknownIllnessStatus, one_sigma = one_sigma, two_sigma = two_sigma, three_signma = three_sigma, school_color = school_color, latitude = latitude, longitude = longitude }); } } return school_list; }
protected void Page_Load(object sender, EventArgs e) { school_district_id = Convert.ToInt32(Session["manage_school_district_id"]); if (!String.IsNullOrEmpty(Request.QueryString["schoolID"])) { int school_id = Convert.ToInt32(Request.QueryString["schoolID"]); siteSchoolWeeklyAbsenteeData.SelectCommand = "SELECT * FROM qHtl_DailyClassroomAbsenteeData WHERE MarkAsDelete = 0 AND SchoolID = " + school_id + " ORDER BY DataDate, School DESC"; qOrg_School school = new qOrg_School(school_id); lblTitle.Text = school.School + " Daily Absentee Data"; } else { siteSchoolWeeklyAbsenteeData.SelectCommand = "SELECT * FROM qHtl_DailyClassroomAbsenteeData WHERE MarkAsDelete = 0 ORDER BY DataDate, School DESC"; lblTitle.Text = "All Classrooms Daily Absentee Data"; } if (!Page.IsPostBack) { startDate = null; endDate = null; var schools = qOrg_School.GetSchoolsByDistrictID(school_district_id); string school_options_html = string.Empty; school_options_html += "<li><a href=\"daily-school-absentee-data.aspx\">All Schools</a></li>"; if (schools != null) { foreach (var s in schools) { school_options_html += "<li><a href=\"daily-school-absentee-data.aspx?schoolID=" + s.SchoolID + "\">" + s.School + "</a></li>"; } } litGroupTypeOptions.Text = school_options_html; } }
protected void Page_Load(object sender, EventArgs e) { Page.Header.DataBind(); int user_id = Convert.ToInt32(Context.Items["UserID"]); curr_user_id = user_id; litUserID.Text = Convert.ToString(user_id); final_manage_url = manage_url + "/public/launch-as-user.aspx?key=" + key + "&userID=" + curr_user_id; if (!Page.IsPostBack) { // load site preferences string site_title = System.Configuration.ConfigurationManager.AppSettings["Site_Title"]; string site_name = System.Configuration.ConfigurationManager.AppSettings["Site_ShortName"]; string logo_url = System.Configuration.ConfigurationManager.AppSettings["Site_LogoUrl"]; string nav_mode = System.Configuration.ConfigurationManager.AppSettings["Site_NavMode"]; string join_group_type = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["Register_JoinGroupType"]); string group_type = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["Members_GroupType"]); // either health or school string invitation_type = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["Members_InvitationTypes"]); string site_explorer_active = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["Site_ExplorersActive"]); litSiteName.Text = site_name; if (!String.IsNullOrEmpty(Request.QueryString["campaignID"])) campaign_id = Convert.ToInt32(Request.QueryString["campaignID"]); string curr_url = Request.Url.ToString(); if (!String.IsNullOrEmpty(Request.QueryString["schoolID"])) { qOrg_School school = new qOrg_School(Convert.ToInt32(Request.QueryString["schoolID"])); if (school.SchoolID > 0) manage_page_title.Text = school.School; } else if (curr_url.Contains("school-district")) manage_page_title.Text = "District Absentee Data"; else manage_page_title.Text = "Manage " + site_name; if (!String.IsNullOrEmpty(site_explorer_active)) { if (site_explorer_active == "true") plhExplorers.Visible = true; } qPtl_User user = new qPtl_User(user_id); lblUserName.Text = user.UserName; lblNotifications.Text = ""; string baseUrl = Request.Url.Scheme + "://" + Request.Url.Authority + Request.ApplicationPath.TrimEnd('/') + "/"; string img_url = string.Empty; if (!String.IsNullOrEmpty(user.ProfilePict)) img_url = baseUrl + "user_data/" + user.UserName + "/" + user.ProfilePict + ".ashx?width=32&height=27&mode=crop"; else img_url = baseUrl + "images/mylife_portrait_default.jpg.ashx?width=32&height=27&mode=crop"; imgProfilePicture.ImageUrl = img_url; string roles = Convert.ToString(Context.Items["UserRoles"]); if (roles.Contains("Site Host") || roles.Contains("Member") || roles.Contains("Site Admin")) plhAccessSite.Visible = true; string curr_space_id = Convert.ToString(Session["manage_space_id"]); space_id = Convert.ToInt32(Session["manage_space_id"]); // hide nav options (tiles and breadcrumbs) and only show based one analysis below plhSiteLevelNavTiles.Visible = false; plhSiteHomeNav.Visible = false; plhSpaceHomeNav.Visible = false; plhBreadcrumbs.Visible = false; plhCampaignHomeNav.Visible = false; plhCurrentPageNav.Visible = false; plhSchoolDistrict.Visible = false; if (user.HighestRole == "Site Admin" || user.HighestRole == "Site Host" || user.HighestRole == "Site Reports") { plhSite.Visible = true; ddlSpaces.Visible = false; plhSiteLevelNavTiles.Visible = true; if (curr_url.Contains("/manage/site/")) { if (!curr_url.Contains("/manage/site/default.aspx")) { plhSiteHomeNav.Visible = true; plhBreadcrumbs.Visible = true; } } else if (curr_url.Contains("/manage/spaces/")) { plhSiteLevelNavTiles.Visible = false; plhSiteHomeNav.Visible = true; if (!curr_url.Contains("/manage/spaces/default.aspx")) if (space_id > 0) plhSpaceHomeNav.Visible = true; plhBreadcrumbs.Visible = true; } else if (curr_url.Contains("/manage/campaigns/")) { plhSiteLevelNavTiles.Visible = false; plhSiteHomeNav.Visible = true; if (space_id > 0) plhSpaceHomeNav.Visible = true; plhBreadcrumbs.Visible = true; plhCampaignHomeNav.Visible = true; } } else if (user.HighestRole == "School District Admin" || user.HighestRole == "School District Reports") { plhSchoolDistrict.Visible = true; ddlSpaces.Visible = false; } else if (user.HighestRole == "Insurer Admin" || user.HighestRole == "Insurer Reports") { plhInsurer.Visible = true; ddlSpaces.Visible = false; } else if (user.HighestRole == "Advisor" || user.HighestRole == "Space Admin" || user.HighestRole == "Space Reports" || roles.Contains("Space Admin") || roles.Contains("Space Reports")) { plhSpace.Visible = true; } else if (user.HighestRole == "Campaign Admin" || user.HighestRole == "Campaign Reports") plhCampaign.Visible = true; if (roles.Contains("Site Admin") || roles.Contains("Host") || roles.Contains("Site Reports") || roles.Contains("Insurer Admin") || roles.Contains("Insurer Reports")) { populateSpaces("all"); } else populateSpaces("limited"); if (!String.IsNullOrEmpty(curr_space_id)) { // load data for this space loadSpaceData(Convert.ToInt32(Session["manage_space_id"])); ddlSpaces.SelectedValue = Convert.ToString(curr_space_id); } else { // get the first option in the list and load information for that if (ddlSpaces.Items.Count > 0) { string first_item = ddlSpaces.Items[0].Value; if (!String.IsNullOrEmpty(first_item)) { loadSpaceData(Convert.ToInt32(first_item)); Session["manage_space_id"] = Convert.ToString(ddlSpaces.SelectedValue); curr_space_id = Convert.ToString(Session["manage_space_id"]); ddlSpaces.SelectedValue = Convert.ToString(Session["manage_space_id"]); } } } // menu optimizations plhGroupsHealthProviders.Visible = false; plhGroupsSchools.Visible = true; if (!String.IsNullOrEmpty(join_group_type)) { if (join_group_type == "health") { plhGroupsHealthProviders.Visible = true; plhGroupsSchools.Visible = false; } } if (invitation_type == "family") plhFamilyInvitations.Visible = true; else if (invitation_type == "moderated group") plhGroupInvitations.Visible = true; // check for back nav options if (curr_url.Contains("campaign-details.aspx")) { litPageTitle.Text = "Campaign Dashboard"; } else if (curr_url.Contains("campaigns/enrolled-members.aspx")) { litPageTitle.Text = "Enrolled Members"; } else if (curr_url.Contains("campaigns/health-kit-orders.aspx")) { litPageTitle.Text = "Health Kits Ordered"; } else if (curr_url.Contains("campaign-pages.aspx")) { litPageTitle.Text = "Campaign Pages"; } else if (curr_url.Contains("campaign-emails.aspx")) { litPageTitle.Text = "Campaign Emails"; } else if (curr_url.Contains("campaign-messages.aspx")) { litPageTitle.Text = "Campaign Messages"; } else if (curr_url.Contains("campaign-assessments.aspx")) { litPageTitle.Text = "Campaign Assessments"; } else if (curr_url.Contains("campaign-invited.aspx")) { litPageTitle.Text = "Campaign Invited Contacts"; } else if (curr_url.Contains("campaign-members.aspx")) { litPageTitle.Text = "Campaign Enrolled Members"; } else if (curr_url.Contains("campaign-reports.aspx")) { litPageTitle.Text = "Campaign Reports"; } else if (curr_url.Contains("campaign-library.aspx")) { litPageTitle.Text = "Campaign Library"; } if (!String.IsNullOrEmpty(manage_health)) if (manage_health == "true") plhHealthMenu.Visible = true; plhGroupTypeSchool.Visible = true; plhGroupTypeHealth.Visible = false; if (!String.IsNullOrEmpty(group_type)) { if (group_type == "health") { plhGroupTypeHealth.Visible = true; plhGroupTypeSchool.Visible = false; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int school_id = 0; if (!String.IsNullOrEmpty(Request.QueryString["schoolID"])) school_id = Convert.ToInt32(Request.QueryString["schoolID"]); // get school daily summary var daily_summary = qHtl_DailySchoolAbsenteeData.GetSchoolDailySummaryByDate(school_id, Convert.ToString(curr_date)); // school qOrg_School school = new qOrg_School(school_id); litSchoolTitle.Text = school.School; string address = string.Empty; address = school.Address1; if (!String.IsNullOrEmpty(school.Address2)) address += "<br>" + school.Address2; address += "<br>" + school.City; address += ", " + school.StateProvince; address += " " + school.PostalCode; litSchoolAddress.Text = address; litSchoolPhone.Text = school.SchoolPhone; litSchoolFax.Text = school.SchoolFax; litSchoolLevel.Text = school.SchoolLevel; litDistrict.Text = school.District; // get classroom data List<ClassroomData> data = new List<ClassroomData>(); data = qHtl_DailyClassroomAbsenteeData.LoadDailyClassroomDataInfoList(curr_date, school_id); // get past data string curr_mode = string.Empty; string mode_x_axis = "4 Weeks"; if (!String.IsNullOrEmpty(Request.QueryString["mode"])) { curr_mode = Request.QueryString["mode"]; if (curr_mode == "28_day") { lit28DayTitle.Text = "4 Weeks of " + school.School + " Absentee Data"; mode_x_axis = "4 Weeks"; } else if (curr_mode == "this_year") { lit28DayTitle.Text = "Current School Year " + school.School + " Absentee Data"; mode_x_axis = "Current School Year"; } else { lit28DayTitle.Text = "4 Weeks of " + school.School + " Absentee Data"; mode_x_axis = "4 Weeks"; } } else lit28DayTitle.Text = "4 Weeks of " + school.School + " Absentee Data"; // build options string filter_options = string.Empty; string qs_options = string.Empty; if (!String.IsNullOrEmpty(Request.QueryString["currDate"])) qs_options = "currDate=" + Request.QueryString["currDate"]; filter_options += "<li><a href=\"/manage/school-districts/default.aspx?" + qs_options + "&mode=28_day\">Last 28 Days</a></li>"; filter_options += "<li><a href=\"/manage/school-districts/default.aspx?" + qs_options + "&mode=this_year\">This School Year</a></li>"; litFilterByDateOptions.Text = filter_options; // get 28 days of district data List<SchoolData> d_data = new List<SchoolData>(); d_data = qHtl_DailySchoolAbsenteeData.LoadDayDailySchoolDataInfoListByMode(curr_mode, curr_date, school_id); litDailyDashboardTitle.Text = school.School + " Absentee Data for " + String.Format("{0:dddd, MMMM d, yyyy}", curr_date); litCalendarDate.Text = String.Format("{0:dddd, MMMM d, yyyy}", curr_date); litStatusCurrentDay.Text = String.Format("{0:dddd, MMMM d, yyyy}", curr_date); litTotalEnrolled.Text = String.Format("{0:0,0}", daily_summary.TotalEnrolled); litTotalStudents.Text = String.Format("{0:0,0}", daily_summary.TotalEnrolled); litTotalAbsent.Text = String.Format("{0:0,0}", daily_summary.TotalAbsent); litTotalSick.Text = String.Format("{0:0,0}", daily_summary.TotalSick); litAbsenteeRate.Text = Convert.ToString(Math.Round(daily_summary.Rate, 2)); litHistoricAbsenteeRate.Text = Convert.ToString(Math.Round(daily_summary.HistoricRate, 2)); // ******************* google map -- school status ******************* string strJSMap = string.Empty; strJSMap += "<script>\n"; strJSMap += "function initialize() {\n"; strJSMap += "var myLatlng = new google.maps.LatLng(" + school.Latitude + ", " + school.Longitude + ");\n"; strJSMap += "var mapOptions = {\n"; strJSMap += "zoom: 10,\n"; strJSMap += "scrollwheel: false,\n"; strJSMap += "center: myLatlng\n"; strJSMap += "}\n"; strJSMap += "var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\n"; strJSMap += "var marker = new google.maps.Marker({position: myLatlng, map: map, title: '" + school.School + "'});};\n\n"; strJSMap += "google.maps.event.addDomListener(window, 'load', initialize);\n"; strJSMap += "</script>\n\n"; litMap.Text = strJSMap; // ********************************************************************* if (data != null) { // create opening/closing for chart javascript string strJSLoad = string.Empty; string strJSOpening = string.Empty; strJSOpening += "<script type=\"text/javascript\">\n"; litJSOpening.Text = strJSOpening; string strJSClosing = string.Empty; strJSClosing += "</script>\n"; litJSClosing.Text = strJSClosing; string strJSChart = string.Empty; // ******************* google chart bar -- school list ******************* string school_chart_title = "Classroom Absentee Rates " + String.Format("{0:M/d/yyyy}", curr_date); strJSChart += "function drawAbsences() {\n"; strJSChart += "var dataAbsentee = google.visualization.arrayToDataTable([\n"; strJSChart += "['Classroom', 'Classroom Daily Absentee Rate', { role: 'style' }, 'School Daily Absentee Rate', 'School Moving Average Absentee Rate'],\n"; int j = 0; foreach (var s in data) { if (j < data.Count && j > 0) strJSChart += ",\n"; strJSChart += "['" + s.chart_classroom_name + "', " + Math.Round(s.rate, 2) + ", '" + s.classroom_color + "', " + Math.Round(daily_summary.Rate, 2) + ", " + Math.Round(daily_summary.HistoricRate, 2) + "]"; j++; } strJSChart += "]);\n"; strJSChart += "var options = {\n"; strJSChart += "title: '" + school_chart_title + "',\n"; strJSChart += "hAxis: {tile: \"Schools\", slantedText: true},\n"; strJSChart += "vAxis: {title: 'Absentee Rate (%)'},\n"; strJSChart += "seriesType: \"bars\",\n"; strJSChart += "series: {1: {color: 'gray', type: \"line\"}, 2: {color: 'blue', type: \"line\"}}\n"; strJSChart += "};\n\n"; strJSChart += "var chart = new google.visualization.ComboChart(document.getElementById('visualizationSchoolAbsences'))\n"; strJSChart += "chart.draw(dataAbsentee, options);\n\n"; strJSChart += "}\n"; strJSLoad += "drawAbsences();\n"; strJSChart += "var selectHandler = function(e) {\n"; strJSChart += "alert('just clicked on this item')\n"; strJSChart += "window.location = data.getValue(chart.getSelection()[0]['row'], 1 );\n"; strJSChart += "}\n"; strJSChart += "google.visualization.events.addListener(chart, 'select', selectHandler);\n"; litClassrooms.Text = "<div id=\"visualizationSchoolAbsences\" style=\"height: 600px;\"></div>"; // ********************************************************************* // ******************* google chart pie -- illnesses ******************* int total_illness = daily_summary.Gastrointestinal + daily_summary.Rash + daily_summary.Respiratory + daily_summary.Rash + daily_summary.OtherIllness; int total_unknown = daily_summary.TotalAbsent - total_illness; strJSChart += "function drawIllnesses() {\n"; strJSChart += "var data = google.visualization.arrayToDataTable([\n"; strJSChart += "['Reason', 'Nuumber of Absences'],\n"; strJSChart += "['Illness', " + total_illness + "],\n"; strJSChart += "['Unknown', " + total_unknown + "]\n"; strJSChart += "]);\n"; strJSChart += "new google.visualization.PieChart(document.getElementById('visualizationIllness')).draw(data, {title:\"Types of Absences\"});\n"; strJSChart += "}\n"; strJSLoad += "drawIllnesses();\n"; litTypesOfIllnessesChartGoogle.Text = "<div id=\"visualizationIllness\" style=\"width: 600px; height: 400px;\"></div>"; // ********************************************************************* // ******************* google chart bar -- symptoms ******************* strJSChart += "function drawSymptoms() {\n"; strJSChart += "var wrapper = new google.visualization.ChartWrapper({\n"; strJSChart += "chartType: 'ColumnChart',\n"; strJSChart += "dataTable: [['', 'Gastrointestinal', 'Respiratory', 'Rash', 'Other'],"; strJSChart += "['', " + daily_summary.Gastrointestinal + ", " + daily_summary.Respiratory + ", " + daily_summary.Rash + ", " + daily_summary.OtherIllness + "]],\n"; strJSChart += "options: {'title': 'Types of Illnesses'},\n"; strJSChart += "containerId: 'visualization'\n"; strJSChart += "});\n"; strJSChart += "wrapper.draw();\n"; strJSChart += "}\n\n"; strJSLoad += "drawSymptoms();\n"; litTypesOfSymptomsChartGoogle.Text = "<div id=\"visualization\" style=\"width: 600px; height: 400px;\"></div>"; // ********************************************************************* // ******************* google chart -- absentee rate ******************* strJSChart += "function drawAbsenteeRates() {\n"; strJSChart += "var dataAbsenteeRates = new google.visualization.DataTable();\n"; strJSChart += "dataAbsenteeRates.addColumn('string', 'Date');\n"; strJSChart += "dataAbsenteeRates.addColumn('number', 'School Daily Absentee Rate');\n"; strJSChart += "dataAbsenteeRates.addColumn({type:'string', role:'annotation'});\n"; strJSChart += "dataAbsenteeRates.addColumn({type:'string', role:'annotationText'});\n"; strJSChart += "dataAbsenteeRates.addColumn('number', 'School Moving Average Absentee Rate');\n"; strJSChart += "dataAbsenteeRates.addRows([\n"; int l = 0; string prior_status_html = string.Empty; foreach (var r in d_data) { if (l < d_data.Count && l > 0) strJSChart += ",\n"; string curr_chart_date = r.data_date.ToString("M/d/yyyy"); if (r.data_date == curr_date) { strJSChart += "['" + String.Format("{0:d}", curr_chart_date) + "', " + Math.Round(r.rate, 2) + ", 'Report Date', '" + r.data_date.ToString("M/d/yyyy") + "', " + Math.Round(r.moving_rate_std, 2) + "]"; } else { strJSChart += "['" + String.Format("{0:d}", curr_chart_date) + "', " + Math.Round(r.rate, 2) + ", null, null, " + Math.Round(r.moving_rate_std, 2) + "]"; } // build list of prior school day status indicators prior_status_html += "<tr><td>" + String.Format("{0:d}", curr_chart_date) + "</td>"; if (r.a_warning == true) { prior_status_html += "<td width=\"70%\" align=\"center\"><a class=\"btn btn-red\" href=\"javascript:openSchoolWindowGeneric('/manage/school-districts/school-default.aspx?schoolID=" + r.school_id + "&currDate=" + r.data_date + "')\"><font color=\"white\">3 Sigma Warning <i class=\"icon-warning-sign\"></i></font></a></td>"; } else if (r.b_warning == true) { prior_status_html += "<td width=\"70%\" align=\"center\"><a class=\"btn btn-orange\" href=\"javascript:openSchoolWindowGeneric('/manage/school-districts/school-default.aspx?schoolID=" + r.school_id + "&currDate=" + r.data_date + "')\"><font color=\"white\">Sustained 2-3 Sigma Watch <i class=\"icon-warning-sign\"></i></font></a></td>"; } else if (r.c_warning == true) { prior_status_html += "<td width=\"70%\" align=\"center\"><a class=\"btn btn-lime\" href=\"javascript:openSchoolWindowGeneric('/manage/school-districts/school-default.aspx?schoolID=" + r.school_id + "&currDate=" + r.data_date + "')\"><font color=\"black\">Consistently Above Mean Watch <i class=\"icon-warning-sign\"></i></font></a></td>"; } else if (r.d_warning == true) { prior_status_html += "<td width=\"70%\" align=\"center\"><a class=\"btn btn-blue\" href=\"javascript:openSchoolWindowGeneric('/manage/school-districts/school-default.aspx?schoolID=" + r.school_id + "&currDate=" + r.data_date + "')\"><font color=\"white\">Sustained Above 1 Sigma Alert <i class=\"icon-warning-sign\"></i></font></a></td>"; } else if (r.e_warning == true) { prior_status_html += "<td width=\"70%\" align=\"center\"><a class=\"btn btn-purple\" href=\"javascript:openSchoolWindowGeneric('/manage/school-districts/school-default.aspx?schoolID=" + r.school_id + "&currDate=" + r.data_date + "')\"><font color=\"white\">Sustained Increase Alert <i class=\"icon-warning-sign\"></i></font></a></td>"; } else if (r.f_warning == true) { prior_status_html += "<td width=\"70%\" align=\"center\"><a class=\"btn btn-green\" href=\"javascript:openSchoolWindowGeneric('/manage/school-districts/school-default.aspx?schoolID=" + r.school_id + "&currDate=" + r.data_date + "')\"><font color=\"white\">2 Sigma Alert <i class=\"icon-warning-sign\"></i></font></a></td>"; } else { prior_status_html += "<td width=\"70%\" align=\"center\">Normal <i class=\"icon-ok-sign\"></i></font></td>"; } prior_status_html += "</tr>"; l++; } litSchoolStatusPrior.Text = prior_status_html; strJSChart += "\n]);\n"; strJSChart += "var options = {\n"; strJSChart += "title: '" + school.School + " Absenteeism Trends',\n"; strJSChart += "hAxis: {title: '" + mode_x_axis + "', slantedText: true},\n"; strJSChart += "vAxis: {title: 'School Absentee Rate (%)'},\n"; strJSChart += "height: 500\n"; strJSChart += "};\n"; strJSChart += "var chart = new google.visualization.LineChart(document.getElementById('visualizationAbsenteeRate'));\n"; strJSChart += "chart.draw(dataAbsenteeRates, options);\n"; strJSChart += "}\n"; strJSLoad += "drawAbsenteeRates();\n"; lit28DaSchoolRateChart.Text = "<div id=\"visualizationAbsenteeRate\" style=\"height: 600px;\"></div>"; // ********************************************************************* // add all finalized JS string finalJSLoad = "google.load(\"visualization\", \"1.1\", {packages:[\"corechart\"]});\n"; finalJSLoad += "google.setOnLoadCallback(init);\n\n"; finalJSLoad += "function init() {\n"; finalJSLoad = finalJSLoad + strJSLoad + "\n}\n\n"; litJSChart.Text = strJSChart; // finalize load code litJSLoad.Text = "<script type=\"text/javascript\">\n" + finalJSLoad + "</script>"; int a_e_warnings = 0; string warnings_html = string.Empty; string text = string.Empty; warnings_html += "<ul>"; string warning_type = string.Empty; string warning_message = string.Empty; string tip_message = string.Empty; string warning_label = string.Empty; string warning_color = string.Empty; string warning_html_color = string.Empty; string font_color = "white"; tip_message = daily_summary.School; warning_message = daily_summary.School; if (daily_summary.A_Warning == true) { warning_type = "3 sigma warning"; warning_message += " (3 sigma warning is triggered for a school when current day absentee rate is greater than 3 sigma of the absentee rate)"; tip_message += " Data = [current day absentee rate = " + daily_summary.Rate + ", 3 sigma absentee rate = " + daily_summary.A_WarningValues + "]"; //warnings_html += "<li> <span class=\"label label-important\">" + warning_type + "</span> <a href=\"#\" rel=\"popover\" data-trigger=\"hover\" data-placement=\"left\" title=\"\" data-content=\"" + tip_message + "\" data-original-title=\"" + warning_type + " at " + daily_summary.School + "\">" + warning_message + " <i class=\"icon-exclamation-sign\"></i></li>"; warning_label = "btn-red"; warning_color = "btn-red"; warning_html_color = "#e51400"; a_e_warnings++; } else if (daily_summary.B_Warning == true) { if (!String.IsNullOrEmpty(warning_type)) warning_type += ", Sustained 2-3 Sigma Watch"; else warning_type = "Sustained 2-3 Sigma Watch"; warning_message += " (Sustained 2-3 Sigma Watch is triggered for a school when the 2 of the prior 3 absentee rates exceed 2 sigma of the absentee rate)"; tip_message += " Data = [current day absentee rate = " + daily_summary.Rate + ", 2 sigma absentee rates = " + daily_summary.B_WarningValues + "]"; //warnings_html += "<li> <span class=\"label label-important\">" + warning_type + "</span> <a href=\"#\" rel=\"popover\" data-trigger=\"hover\" data-placement=\"left\" title=\"\" data-content=\"" + tip_message + "\" data-original-title=\"" + warning_type + " at " + daily_summary.School + "\">" + warning_message + " <i class=\"icon-exclamation-sign\"></i></li>"; a_e_warnings++; warning_label = "btn-orange"; warning_html_color = "#f8a31f"; warning_color = "btn-orange"; } else if (daily_summary.C_Warning == true) { if (!String.IsNullOrEmpty(warning_type)) warning_type += ", Consistently Above Mean Watch"; else warning_type = "Consistently Above Mean Watch"; warning_message += " (Consistently Above Mean Watch is triggered for a school when at least 4 of the 5 prior absentee rates all exceed 1 sigma of the absentee rate)"; tip_message += " Data = [current day absentee rate = " + daily_summary.Rate + ", 1 sigma absentee rates = " + daily_summary.C_WarningValues + "]"; //warnings_html += "<li> <span class=\"label label-important\">" + warning_type + "</span> <a href=\"#\" rel=\"popover\" data-trigger=\"hover\" data-placement=\"left\" title=\"\" data-content=\"" + tip_message + "\" data-original-title=\"" + warning_type + " at " + daily_summary.School + "\">" + warning_message + " <i class=\"icon-exclamation-sign\"></i></li>"; a_e_warnings++; warning_label = "btn-lime"; warning_html_color = "#ffff00"; font_color = "black"; } else if (daily_summary.F_Warning == true) { if (!String.IsNullOrEmpty(warning_type)) warning_type += ", 2 Sigma Alert"; else warning_type = "2 Sigma Alert"; warning_message += " (2 Sigma Alert triggered for a school when current day absentee rate is greater than 2 sigma of the absentee rate)"; tip_message += " Data = [current day absentee rate = " + daily_summary.Rate + ", 2 sigma absentee rate = " + daily_summary.F_WarningValues + "]"; //warnings_html += "<li> <span class=\"label label-important\">" + warning_type + "</span> <a href=\"#\" rel=\"popover\" data-trigger=\"hover\" data-placement=\"left\" title=\"\" data-content=\"" + tip_message + "\" data-original-title=\"" + warning_type + " at " + daily_summary.School + "\">" + warning_message + " <i class=\"icon-exclamation-sign\"></i></li>"; a_e_warnings++; warning_html_color = "#393"; warning_label = "btn-green"; } else if (daily_summary.D_Warning == true) { if (!String.IsNullOrEmpty(warning_type)) warning_type += ", Sustained Above 1 Sigma Alert"; else warning_type = "Sustained Above 1 Sigma Alert"; warning_message += " (Sustained Above 1 Sigma Alert is triggered for a school when the 8 prior absentee rates are greater than the historic absentee rate)"; tip_message += " Data = [historic absentee rate = " + daily_summary.HistoricRate + ", 8 days prior absentee rates = " + daily_summary.D_WarningValues + "]"; //warnings_html += "<li> <span class=\"label label-important\">" + warning_type + "</span> <a href=\"#\" rel=\"popover\" data-trigger=\"hover\" data-placement=\"left\" title=\"\" data-content=\"" + tip_message + "\" data-original-title=\"" + warning_type + " at " + daily_summary.School + "\">" + warning_message + " <i class=\"icon-exclamation-sign\"></i></li>"; a_e_warnings++; warning_html_color = "#368ee0"; warning_label = "btn-blue"; } else if (daily_summary.E_Warning == true) { if (!String.IsNullOrEmpty(warning_type)) warning_type += ", Sustained Increase Alert"; else warning_type = "Sustained Increase Alert"; warning_message += " (Sustained Increase Alert is triggered for a school when the 6 prior absentee rates are all increasing)"; tip_message += " Data = [current day absentee rate = " + daily_summary.Rate + ", 8 days prior absentee rates = " + daily_summary.E_WarningValues + "]"; //warnings_html += "<li> <span class=\"label label-important\">" + warning_type + "</span> <a href=\"#\" rel=\"popover\" data-trigger=\"hover\" data-placement=\"left\" title=\"\" data-content=\"" + tip_message + "\" data-original-title=\"" + warning_type + " at " + daily_summary.School + "\">" + warning_message + " <i class=\"icon-exclamation-sign\"></i></li>"; a_e_warnings++; warning_html_color = "#a200ff"; warning_label = "btn-purple"; } if (!String.IsNullOrEmpty(warning_type)) { if (font_color == "black") warnings_html += "<li><div style=\"height:30px!important;\"><a href=\"#\" rel=\"popover\" class=\"btn " + warning_label + " btn-small\" data-trigger=\"hover\" data-placement=\"left\" title=\"\" data-content=\"" + warning_message + ": " + tip_message + "\" data-original-title=\"" + warning_type + " at " + daily_summary.School + "\"><font color=\"black\">" + warning_type + " <i class=\"icon-info-sign\"></i></font></a> " + warning_message + " " + tip_message + "</div></li>"; else warnings_html += "<li><div style=\"height:30px!important;\"><a href=\"#\" rel=\"popover\" class=\"btn " + warning_label + " btn-small\" data-trigger=\"hover\" data-placement=\"left\" title=\"\" data-content=\"" + warning_message + ": " + tip_message + "\" data-original-title=\"" + warning_type + " at " + daily_summary.School + "\">" + warning_type + " <i class=\"icon-info-sign\"></i></a> " + warning_message + " " + tip_message + "</div></li>"; } if (a_e_warnings > 0) { warnings_html += "</ul>"; litHealthWarnings.Text = warnings_html; } litNumAbsenteeWarnings.Text = "<span class=\"badge\">" + a_e_warnings + "</span>"; qHtl_AbsenteeAnalysisVariable variables = new qHtl_AbsenteeAnalysisVariable(daily_summary.SchoolDistrictID); // symptom warnings string s_warning_type = string.Empty; string s_tip_message = string.Empty; string s_warnings_html = string.Empty; int num_symptom_warnings = 0; string currentStatus = "normal"; plhStatusNormal.Visible = false; plhStatusCaution.Visible = false; plhStatusWarning.Visible = false; string currStatusDescription = string.Empty; string tip_data = string.Empty; if (daily_summary.GastrointestinalStatus == "red") { warning_type = "Gastrointestinal Warning"; tip_message += "A Gastrointestinal warning is triggered for a school when gastroinstestinal-related absenses make up " + variables.RedGastrointestinalBoundary + "% or more of all reported absenses."; tip_data = daily_summary.School + " Gastrointestinal-related absenses on " + String.Format("{0:d}", curr_date) + " = " + Math.Round(daily_summary.GastrointestinalRate, 2) + "%"; num_symptom_warnings++; } if (daily_summary.RashStatus == "red") { warning_type = "Rash Warning"; tip_message += "A Rash warning is triggered for a school when rash-related absenses make up " + variables.RedRashBoundary + "% or more of all resported absenses."; tip_data = daily_summary.School + " Rash-related absenses on " + String.Format("{0:d}", curr_date) + " = " + Math.Round(daily_summary.RashRate, 2) + "%"; ; num_symptom_warnings++; } if (daily_summary.RespiratoryStatus == "red") { warning_type = "Respiratory Warning"; tip_message += "A Respiratory warning is triggered for a school when respiratory-related absenses make up " + variables.RedRespiratoryBoundary + "% or more of all reported absenses."; tip_data = daily_summary.School + " Respiratory-related absenses on " + String.Format("{0:d}", curr_date) + " = " + Math.Round(daily_summary.RespiratoryRate, 2) + "%"; num_symptom_warnings++; } if (!String.IsNullOrEmpty(warning_type)) { s_warnings_html += "<li><div style=\"height:30px!important;\"><a href=\"#\" class=\"btn btn-darkblue btn-small\" rel=\"popover\" data-trigger=\"hover\" data-placement=\"left\" title=\"\" data-content=\"" + tip_message + " " + tip_data + "\" data-original-title=\"" + warning_type + " at " + daily_summary.School + "\">" + warning_type + " <i class=\"icon-info-sign\"></i></a>"; s_warnings_html += "</div></li>"; } if (a_e_warnings > 0) { currentStatus = "warning"; currStatusDescription += "There are absentee warnings.<br>"; } litNumSymptomWarnings.Text = "<span class=\"badge\">" + num_symptom_warnings + "</span>"; string status_text = "School Status for <strong>" + String.Format("{0:M/d/yyyy}", curr_date) + "</strong><br><br>"; if (currentStatus == "normal") { plhStatusNormal.Visible = true; currStatusDescription = "There are no absentee or symptom warnings. All other trends appear to be normal."; } //else if (currentStatus == "caution") //{ // plhStatusCaution.Visible = true; // currStatusDescription = "There are illness symptom trends of concern."; //} else if (currentStatus == "warning") { plhStatusWarning.Visible = true; litWarningStatusColor.Text = "bgcolor=\"" + warning_html_color + "\""; litWarningFooter.Text = warning_type; } litNormalHeader.Text = status_text; litCautionHeader.Text = status_text; litWarningHeader.Text = status_text; litStatusDescription.Text = "<i class=\"icon-info-sign\"></i> " + currStatusDescription; } } }
public static qOrg_School GetSchoolFromAutoPopulateDropdown(string school_name) { var school = new qOrg_School(); string eval = school_name; if (school_name.Contains(" - ")) { int get_dash = school_name.IndexOf(" - "); eval = school_name.Substring(0, get_dash); } school.container.Select( new DbQuery { Where = string.Format("School LIKE '%{0}%'", eval) }); return school; }
public static qOrg_School GetSchoolBySelector(string selector) { var school = new qOrg_School(); string sql = string.Format("SchoolSelector = '{0}' AND Available = 'Yes' AND MarkAsDelete = 0", selector); school.container.Select( new DbQuery { Where = sql }); return school; }
protected void loadPageInfo(int school_id) { qOrg_School school = new qOrg_School(school_id); litTitle.Text = "<h3>" + school.School + "</h3>"; }
protected void Page_Load(object sender, EventArgs e) { school_district_id = Convert.ToInt32(Session["manage_school_district_id"]); if (!String.IsNullOrEmpty(Request.QueryString["schoolID"])) { int school_id = Convert.ToInt32(Request.QueryString["schoolID"]); siteSchoolHealthWarnings.SelectCommand = "SELECT * FROM qHtl_HealthWarnings_Schools_View WHERE MarkAsDelete = 0 AND ReferenceID = " + school_id + " ORDER BY DataDate, School DESC"; qOrg_School school = new qOrg_School(school_id); lblTitle.Text = school.School + " Health Warnings"; } else { siteSchoolHealthWarnings.SelectCommand = "SELECT * FROM qHtl_HealthWarnings_Schools_View WHERE MarkAsDelete = 0 ORDER BY DataDate, School DESC"; lblTitle.Text = "School Health Warnings"; } if (!Page.IsPostBack) { startDate = null; endDate = null; } }
protected void btnSave_OnClick(object sender, System.EventArgs e) { Page.Validate("form"); if (Page.IsValid) { int user_id = Convert.ToInt32(Context.Items["UserID"]); if (!String.IsNullOrEmpty(Request.QueryString["schoolID"])) { school_id = Convert.ToInt32(Request.QueryString["schoolID"]); qOrg_School school = new qOrg_School(school_id); school.School = txtName.Text; school.SchoolType = ddlType.SelectedValue; school.Address1 = txtAddress1.Text; school.Address2 = txtAddress2.Text; school.City = txtCity.Text; school.StateProvince = ddlState.SelectedValue; school.PostalCode = txtPostalCode.Text; school.Country = ddlCountry.SelectedValue; school.SchoolPhone = txtPhone.Text; if (!String.IsNullOrEmpty(ddlSchoolDistrict.SelectedValue)) school.SchoolDistrictID = Convert.ToInt32(ddlSchoolDistrict.SelectedValue); school.Update(); } else { qOrg_School school = new qOrg_School(); school.ScopeID = 1; school.Created = DateTime.Now; school.CreatedBy = user_id; school.LastModified = DateTime.Now; school.LastModifiedBy = user_id; school.Available = "Yes"; school.MarkAsDelete = 0; school.School = txtName.Text; school.SchoolType = ddlType.SelectedValue; school.Available = rblAvailable.SelectedValue; school.Address1 = txtAddress1.Text; school.Address2 = txtAddress2.Text; school.City = txtCity.Text; school.StateProvince = ddlState.SelectedValue; school.Country = ddlCountry.SelectedValue; school.PostalCode = txtPostalCode.Text; school.SchoolPhone = txtPhone.Text; if (!String.IsNullOrEmpty(ddlSchoolDistrict.SelectedValue)) school.SchoolDistrictID = Convert.ToInt32(ddlSchoolDistrict.SelectedValue); school.Insert(); school_id = school.SchoolID; } bool geo_coding_success = true; /* bool geo_coding_success; try { Quartz.Data.qDbs_CustomWorkflows qFlow = new Quartz.Data.qDbs_CustomWorkflows(); int curr_user_id = Convert.ToInt32(Context.Items["UserID"]); string workflowSuccess = qFlow.RunWorkflow(108, 102, school_id, curr_user_id); geo_coding_success = true; } catch { geo_coding_success = false; } */ if (!String.IsNullOrEmpty(Request.QueryString["schoolID"])) { if (geo_coding_success == true) { lblMessage.Text = "*** Record Successfully Updated ***"; lblMessageBottom.Text = "*** Record Successfully Updated ***"; Response.Redirect(Request.Url.ToString() + "&mode=update-successful"); } else { //lblMessage.Text = "*** Record Successfully Updated BUT GeoCoding of the Address Failed ***"; //lblMessageBottom.Text = "*** Record Successfully Updated BUT GeoCoding of the Address Failed ***"; lblMessage.Text = "*** Record Successfully Updated ***"; lblMessageBottom.Text = "*** Record Successfully Updated ***"; Response.Redirect(Request.Url.ToString() + "?mode=add-successful&schoolID=" + school_id); } } else { Response.Redirect(Request.Url.ToString() + "?mode=add-successful&schoolID=" + school_id); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { populateSchoolDistricts(); if (!String.IsNullOrEmpty(Request.QueryString["schoolID"])) { school_id = Convert.ToInt32(Request.QueryString["schoolID"]); qOrg_School school = new qOrg_School(school_id); lblTitle.Text = "Edit School (ID: " + school.SchoolID + ")"; txtName.Text = school.School; ddlType.SelectedValue = school.SchoolType; txtAddress1.Text = school.Address1; txtAddress2.Text = school.Address2; txtCity.Text = school.City; ddlState.SelectedValue = school.StateProvince; txtPostalCode.Text = school.PostalCode; txtPhone.Text = school.SchoolPhone; rblAvailable.SelectedValue = school.Available; ddlSchoolDistrict.SelectedValue = Convert.ToString(school.SchoolDistrictID); qGis_Object map = new qGis_Object(); map = qGis_Object.GetGISObjectByContentTypeAndReference((int)qSoc_ContentType.Types.School, school_id); if (map != null) { if (map.GISObjectID > 0) { plhMap.Visible = true; school_name = school.School; address1 = school.Address1; address2 = school.Address2; city = school.City; state_province = school.StateProvince; postal_code = school.PostalCode; phone = school.SchoolPhone; longitude = Convert.ToString(map.Longitude); latitude = Convert.ToString(map.Latitude); } } } else { lblTitle.Text = "New School"; plhTools.Visible = false; rblAvailable.SelectedValue = "Yes"; } if (Convert.ToString(Request.QueryString["mode"]) == "add-successful") { lblMessage.Text = "*** Record Successfully Added ***"; lblMessageBottom.Text = "*** Record Successfully Added ***"; } else if (Convert.ToString(Request.QueryString["mode"]) == "update-successful") { lblMessage.Text = "*** Record Successfully Updated ***"; lblMessageBottom.Text = "*** Record Successfully Updated ***"; } } }