protected void btnShowReport_Click(object sender, EventArgs e) { try { lblFeedback.Text = ""; int surveyNum = int.Parse(ddlOldSurveys.SelectedValue); if (radSection.Checked) { // int.Parse(radlOldSurveys.SelectedValue), DataTable dt = new UdiShared().GetRoadsNetworkUDI(RoadType.Section, ddlMunic.SelectedValue, surveyNum); if (dt.Rows.Count > 0) { Session.Add("option", "radbyLane4MainSt"); Session.Add("ReportData", dt); string url = "ViewWholeRoadsUDI.aspx"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RedirectScriptCoupon", "window.open('" + url + "', '_blank')", true); } else { throw new Exception(Feedback.NoData()); } } else if (radIntersection.Checked) { DataTable dt = new UdiShared().GetRoadsNetworkUDI(RoadType.Intersect, ddlMunic.SelectedValue, surveyNum); if (dt.Rows.Count > 0) { Session.Add("option", "radByIntersect"); Session.Add("ReportData", dt); string url = "ViewWholeRoadsUDI.aspx"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RedirectScriptCoupon", "window.open('" + url + "', '_blank')", true); } else { throw new Exception(Feedback.NoData()); } } else if (radRegionSecondary.Checked) { DataTable dt = new UdiShared().GetRoadsNetworkUDI(RoadType.RegionSecondarySt, ddlMunic.SelectedValue, surveyNum); if (dt.Rows.Count > 0) { Session.Add("option", "radByRegion"); Session.Add("ReportData", dt); string url = "ViewWholeRoadsUDI.aspx"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RedirectScriptCoupon", "window.open('" + url + "', '_blank')", true); } else { throw new Exception(Feedback.NoData()); } } } catch (Exception ex) { lblFeedback.Text = ex.Message; } }
protected void btnShowMaintDecUdi_Click(object sender, EventArgs e) { try { lblAddFeedback.Text = ""; DataTable dt = new UdiShared().GetRoadNetworkItemUdiReport(radSection.Checked, radIntersect.Checked, radRegion.Checked, radLSampleWise.Checked, radLaneWise.Checked, radSectionWise.Checked, radIntersectWise.Checked, radISampleWise.Checked, radRegionWise.Checked, radSecStWise.Checked, int.Parse(ddlMainStreets.SelectedValue), int.Parse(ddlRegions.SelectedValue)); if (dt.Rows.Count > 0) { string option = ""; if (radSection.Checked) { option = ((radLSampleWise.Checked) ? "radLSampleWise" : ((radLaneWise.Checked) ? "radLaneWise" : ((radSectionWise.Checked) ? "radSectionWise" : ""))); } else if (radIntersect.Checked) { option = ((radISampleWise.Checked) ? "radISampleWise" : ((radIntersectWise.Checked) ? "radIntersectWise" : "")); } else if (radRegion.Checked) { option = ((radRegionWise.Checked) ? "radRegionWise" : ((radSecStWise.Checked) ? "radSecStWise" : "")); } else { option = ""; } Session.Add("option", option); Session.Add("ReportData", dt); string url = "ViewUdiCompareReport.aspx"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RedirectScriptCoupon", "window.open('" + url + "', '_blank')", true); } else { lblAddFeedback.Text = Feedback.NoData(); } } catch (Exception ex) { lblAddFeedback.Text = ex.Message; } }
protected void ddlRegionSecondaryStreets_SelectedIndexChanged(object sender, EventArgs e) { try { lblFeedback.Text = ""; lblUdiAfter.Text = ""; decimal?udi = UdiShared.GetRoadNetworkItemUdi(ddlMainStreetSection.SelectedValue, ddlMainStreetIntersection.SelectedValue, ddlSamples.SelectedValue, ddlRegions.SelectedValue, ddlRegionSecondaryStreets.SelectedValue); lblUdiBefore.Text = (udi == null) ? "" : udi.ToString(); ddlMaintDecisions_SelectedIndexChanged(sender, e); } catch (Exception ex) { lblFeedback.Text = ex.Message; } }
protected void btnShowMaintDecUdi_Click(object sender, EventArgs e) { try { lblAddFeedback.Text = ""; if (radSection.Checked && (ddlMainStreetSection.SelectedValue == "0" || string.IsNullOrEmpty(ddlMainStreetSection.SelectedValue))) { throw new Exception(Feedback.NoSectionSelected()); } else if (radIntersect.Checked && (ddlMainStreetIntersection.SelectedValue == "0" || string.IsNullOrEmpty(ddlMainStreetIntersection.SelectedValue))) { throw new Exception(Feedback.NoIntersectionSelected()); } else if (radRegion.Checked && (ddlRegions.SelectedValue == "0" || string.IsNullOrEmpty(ddlRegions.SelectedValue))) { throw new Exception(Feedback.NoRegionSelected()); } DataTable dt = UdiShared.GetRoadNetworkItemUdi(ddlMainStreetSection.SelectedValue, ddlMainStreetIntersection.SelectedValue, ddlRegions.SelectedValue, ddlRegionSecondaryStreets.SelectedValue); if (dt.Rows.Count > 0) { gvUdi.DataSource = dt; gvUdi.DataBind(); } else { gvUdi.DataSource = null; gvUdi.DataBind(); throw new Exception("غير ممسوح"); } } catch (Exception ex) { lblAddFeedback.Text = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { try { Guid id = new Guid(Request.QueryString["id"]); // Check the thread result collection if (ThreadResults.Contains(id)) { // The worker thread has finished // Get the result from the thread result collection //int authorizationId = (int)ThreadResults.Get(id); DataTable dt = (DataTable)ThreadResults.Get(id); // Remove the result from the collection ThreadResults.Remove(id); lblMessage.Text = "انتهى حساب حالة الرصف بنجاح"; lblMessage.ForeColor = Color.Green; UdiShared.StartShapeFileAutoCreationProgram(); } else { lblMessage.Text = "يجري الآن حساب حالة الرصف، الرجاء الانتظار"; lblMessage.ForeColor = Color.Black; Response.AddHeader("Refresh", "2"); } } catch (Exception ex) { lblMessage.Text = ex.Message; } }
protected void ddlMainStreetSection_SelectedIndexChanged(object sender, EventArgs e) { try { lblFeedback.Text = ""; lblUdiAfter.Text = ""; ddlSamples.Items.Clear(); ddlSamples.Items.Add(new ListItem("كل العينات", "0")); ddlSamples.DataBind(); ddlSamples.SelectedValue = "0"; // get UDI decimal?udi = UdiShared.GetRoadNetworkItemUdi(ddlMainStreetSection.SelectedValue, ddlMainStreetIntersection.SelectedValue, ddlSamples.SelectedValue, ddlRegions.SelectedValue, ddlRegionSecondaryStreets.SelectedValue); lblUdiBefore.Text = (udi == null) ? "" : udi.ToString(); ddlMaintDecisions_SelectedIndexChanged(sender, e); } catch (Exception ex) { lblFeedback.Text = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { if (Session["Permissions"] == null || Session["Permissions"].ToString()[7] != '1') { Response.Redirect("~/ASPX/Default.aspx", false); } } lblFeedback.Text = ""; lblDateTime.Text = DateTime.Now.ToString("hh:mm dd/MM/yyyy"); //if (Session["option"] != null) //!IsPostBack && //{ PavementStatusReport rpt = new UdiShared().GetAllPavementStatusTotals(); lblTotalSections.Text = rpt.MainStSectionsTotal.ToString("N1"); lblTotalIntersects.Text = rpt.MainStIntersectsTotal.ToString("N1"); lblTotalMainSt.Text = rpt.MainStTotal.ToString("N1"); lblRegionsTotal.Text = rpt.RegionsTotal.ToString("N1"); lblTotal.Text = rpt.WholeNetworkTotal.ToString("N1"); lblMainStTotalExcellent.Text = rpt.MainStTotalExcellent.ToString("N1"); lblMainStTotalGood.Text = rpt.MainStTotalGood.ToString("N1"); lblMainStTotalFair.Text = rpt.MainStTotalFair.ToString("N1"); lblMainStTotalPoor.Text = rpt.MainStTotalPoor.ToString("N1"); lblMainStTotal.Text = rpt.MainStTotal.ToString("N1"); lblRegionsTotalExcellent.Text = rpt.RegionsTotalExcellent.ToString("N1"); lblRegionsTotalGood.Text = rpt.RegionsTotalGood.ToString("N1"); lblRegionsTotalFair.Text = rpt.RegionsTotalFair.ToString("N1"); lblRegionsTotalPoor.Text = rpt.RegionsTotalPoor.ToString("N1"); lblTotalRegions.Text = rpt.RegionsTotal.ToString("N1"); DataTable dtMainSt = new DataTable(); DataTable dtRegions = new DataTable(); dtMainSt.Columns.Add(new DataColumn("u_rating", typeof(string))); dtMainSt.Columns.Add(new DataColumn("udi_rate_count", typeof(double))); dtMainSt.Rows.Add("Excellent", rpt.MainStTotalExcellent.ToString("N1")); dtMainSt.Rows.Add("Good", rpt.MainStTotalGood.ToString("N1")); dtMainSt.Rows.Add("Fair", rpt.MainStTotalFair.ToString("N1")); dtMainSt.Rows.Add("Poor", rpt.MainStTotalPoor.ToString("N1")); dtRegions.Columns.Add(new DataColumn("u_rating", typeof(string))); dtRegions.Columns.Add(new DataColumn("udi_rate_count", typeof(double))); dtRegions.Rows.Add("Excellent", rpt.RegionsTotalExcellent.ToString("N1")); dtRegions.Rows.Add("Good", rpt.RegionsTotalGood.ToString("N1")); dtRegions.Rows.Add("Fair", rpt.RegionsTotalFair.ToString("N1")); dtRegions.Rows.Add("Poor", rpt.RegionsTotalPoor.ToString("N1")); chtMainStUDI.Palette = System.Web.UI.DataVisualization.Charting.ChartColorPalette.None; chtMainStUDI.PaletteCustomColors = new Color[] { Color.Green, Color.Blue, Color.Yellow, Color.Red }; chtMainStUDI.Series[0].XValueMember = "u_rating"; chtMainStUDI.Series[0].YValueMembers = "udi_rate_count"; chtMainStUDI.Series[0].Label = "#PERCENT"; chtMainStUDI.Series[0].LegendText = "#AXISLABEL"; chtMainStUDI.DataSource = dtMainSt; chtMainStUDI.DataBind(); chtRegionsUDI.Palette = System.Web.UI.DataVisualization.Charting.ChartColorPalette.None; chtRegionsUDI.PaletteCustomColors = new Color[] { Color.Green, Color.Blue, Color.Yellow, Color.Red }; chtRegionsUDI.Series[0].XValueMember = "u_rating"; chtRegionsUDI.Series[0].YValueMembers = "udi_rate_count"; chtRegionsUDI.Series[0].Label = "#PERCENT"; chtRegionsUDI.Series[0].LegendText = "#AXISLABEL"; chtRegionsUDI.DataSource = dtRegions; chtRegionsUDI.DataBind(); //} //else // Response.Redirect("PavementStatus.aspx", false); } catch (Exception ex) { lblFeedback.Text = ex.Message; } finally { Session["option"] = null; } }