Esempio n. 1
0
        private double GetMaxRateInResult(v_RetentionWWoDisEconELPSchoolDistState ds)
        {
            double maxRateInResult = 0;

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                try
                {
                    if (Convert.ToDouble(
                            row[ds._v_RetentionWWoDisEconELPSchoolDistState.
                                Retention_RateColumn.ColumnName].ToString())
                        > maxRateInResult)
                    {
                        maxRateInResult = Convert.ToDouble
                                              (row[ds._v_RetentionWWoDisEconELPSchoolDistState.
                                                   Retention_RateColumn.ColumnName].ToString());
                    }
                }
                catch
                {
                    continue;
                }
            }
            return(maxRateInResult);
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Master.EnableViewState = false;

            base.PrepBLEntity(_retention);

            //set the page heading
            ((SligoCS.Web.WI.WI)Page.Master).SetPageHeading(
                "What percent of students did not advance to the next grade level?");

            _ds = _retention.GetRetentionData2();

            SetLinkChangeSelectedSchoolOrDistrict(ChangeSelectedSchoolOrDistrict);

            SetVisibleColumns2(SligoDataGrid2, _ds, _retention.ViewBy,
                               _retention.OrgLevel, _retention.CompareTo, GlobalValues.STYP);

            GlobalValues.SQL = _retention.SQL;

            this.SligoDataGrid2.DataSource = _ds;

            this.SligoDataGrid2.DataBind();

            graphTitle = GetTitle("Retention Rate", _retention);

            this.SligoDataGrid2.AddSuperHeader(graphTitle);

            this.SligoDataGrid2.ShowSuperHeader = true;

            if (base.GlobalValues.DETAIL != null &&
                base.GlobalValues.DETAIL.ToString() == "NO")
            {
                this.SligoDataGrid2.Visible = false;
            }

            set_state();
            setBottomLink(_retention);

            ////Notes:  graph
            GraphPanel.Visible = false;
            if (CheckIfGraphPanelVisible(GraphPanel) == true)
            {
                SetUpChart(_ds);
            }
            //// graph
        }
Esempio n. 3
0
        /// <summary>
        ///  Set up graph
        /// </summary>
        /// <param name="ds"></param>
        private void SetUpChart(v_RetentionWWoDisEconELPSchoolDistState ds)
        {
            try
            {
                graphTitle     = graphTitle.Replace("<br/>", "\n");
                barChart.Title = graphTitle;

                //Axis Y Settings
                //int axisYStep = 1;
                //int axisYMin = 0;
                //int axisYMax = 10;
                //ArrayList friendlyAxisYName = new ArrayList();
                //GetAxisYSetting(ds, ref axisYStep, ref axisYMin,
                //                    ref axisYMax, ref friendlyAxisYName);
                //barChart.AxisYStep = axisYStep;
                //barChart.AxisYMin = axisYMin;
                //barChart.AxisYMax = axisYMax;
                //barChart.FriendlyAxisYName = friendlyAxisYName;

                barChart.MaxRateInResult = GetMaxRateInResult(ds);

                if (_retention.ViewBy.Key == GroupKeys.All)
                {
                    List <String> friendlyAxisXName = new List <String>();
                    friendlyAxisXName.Add("All Students");
                    barChart.FriendlyAxisXName = friendlyAxisXName;
                }

                barChart.AxisYDescription = "Retention Rate";

                //Bind Data Source & Display
                barChart.DisplayColumnName =
                    ds._v_RetentionWWoDisEconELPSchoolDistState.
                    Retention_RateColumn.ColumnName;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }
        public v_RetentionWWoDisEconELPSchoolDistState GetRetentionData2()
        {
            List <int> schoolTypes = GetSchoolTypesList(this.SchoolType);

            //create a bunch of Generics Lists, automatically populated with a 9 (the default value).
            List <int> sexCodes, raceCodes, disabilityCodes, gradeCodes, econDisadvCodes, ELPCodes;

            base.GetViewByList(ViewBy, OrgLevel, out sexCodes, out raceCodes,
                               out disabilityCodes, out gradeCodes, out econDisadvCodes, out ELPCodes);

            Years = GetYearList(); // base.GetYearList();

            _fullKeys = FullKeyUtils.GetFullKeysList(CompareTo, OrgLevel,
                                                     OrigFullKey, CompareToSchoolsOrDistrict, S4orALL);

            bool useFullkeys = true; //

            _clauseForCompareToSchoolsDistrict =
                GetClauseForCompareToSchoolsDistrict(
                    OrigFullKey, S4orALL,
                    CompareTo, OrgLevel,
                    SCounty, SAthleticConf, SCESA, SRegion,
                    out useFullkeys);

            DALRetention retention = new DALRetention();
            v_RetentionWWoDisEconELPSchoolDistState ds = new v_RetentionWWoDisEconELPSchoolDistState();
            List <string> orderBy = GetOrderByList(ds._v_RetentionWWoDisEconELPSchoolDistState,
                                                   CompareTo, OrigFullKey);

            ds = retention.GetRetentionData2(
                raceCodes, sexCodes, disabilityCodes, Years,
                _fullKeys, gradeCodes,
                schoolTypes, econDisadvCodes, ELPCodes,
                _clauseForCompareToSchoolsDistrict,
                useFullkeys,
                orderBy);

            this.sql = retention.SQL;
            return(ds);
        }