private void CompareToSelectedRedirect()
        {
            System.Diagnostics.Debug.WriteLine("CompareToSelectedRedirect()");
            string   qs       = string.Empty;
            string   filedest = string.Empty;
            OrgLevel ol       = GlobalValues.OrgLevel;

            //hackish escape from redirect::
            String magicPageNameString = "ChooseSelected";

            /*if (ol.Key == OrgLevelKeys.District) filedest = magicPageNameString + "Districts.aspx";
             * else if (ol.Key == OrgLevelKeys.School) filedest = magicPageNameString + "Schools.aspx";
             * else  throw new Exception("Invalid OrgLevel for Selected Fullkeys Redirect");*/
            filedest = magicPageNameString + ".aspx";

            // so that the redirect does not get into an endless loop.
            // and so we can select a different question
            if (Request.FilePath.Contains(magicPageNameString) ||
                Request.FilePath.Contains("questions.aspx") ||
                Request.FilePath.Contains("performance.aspx") ||
                Request.FilePath.Contains("offerings.aspx") ||
                Request.FilePath.Contains("demographics.aspx") ||
                Request.FilePath.Contains("attendance.aspx")
                )
            {
                return;
            }


            qs = UserValues.GetBaseQueryString();
            string NavigateUrl = GlobalValues.CreateURL("~/" + filedest, qs);

            Response.Redirect(NavigateUrl, true);
        }
예제 #2
0
        /// <summary>
        /// Overrides GetViewByList()
        /// </summary>
        /// <param name="viewBy"></param>
        /// <param name="orgLevelKey"></param>
        /// <param name="sexCodes"></param>
        /// <param name="raceCodes"></param>
        /// <param name="disabilityCodes"></param>
        /// <param name="gradeCodes"></param>
        protected override void GetViewByList(Group viewBy, OrgLevel orgLevel, out List <int> sexCodes, out List <int> raceCodes,
                                              out List <int> disabilityCodes, out List <int> gradeCodes, out List <int> econDisadvCodes, out List <int> ELPCodes)
        {
            //basically the same as the base GetViewByList(),
            //except the Grade Code List.  See Bug 386 for details.
            base.GetViewByList(viewBy, orgLevel, out sexCodes, out raceCodes,
                               out disabilityCodes, out gradeCodes, out econDisadvCodes, out ELPCodes);

            gradeCodes = GetGradeCodes();
        }
예제 #3
0
        public override List <string> GetVisibleColumns(Group viewBy,
                                                        OrgLevel orgLevel, CompareTo compareTo, STYP schoolType)
        {
            List <string> retval = base.GetVisibleColumns(viewBy, orgLevel, compareTo, schoolType);

            retval.Add(_ds._v_RetentionWWoDisEconELPSchoolDistState._Total_Enrollment__K_12_Column.ColumnName);
            retval.Add(_ds._v_RetentionWWoDisEconELPSchoolDistState.Completed_School_TermColumn.ColumnName);
            retval.Add(_ds._v_RetentionWWoDisEconELPSchoolDistState.Number_of_RetentionsColumn.ColumnName);
            retval.Add(_ds._v_RetentionWWoDisEconELPSchoolDistState.Retention_RateColumn.ColumnName);

            return(retval);
        }
예제 #4
0
 protected virtual string GetClauseForCompareToSchoolsDistrict(
     string OrigFullKey,
     S4orALL S4orALL,
     CompareTo compareTo,
     OrgLevel orgLevel,
     string SCounty,
     string SAthleticConf,
     string SCESA,
     SRegion SRegion,
     out bool useFullkeys)
 {
     useFullkeys = false;
     return(String.Empty);
 }
        /// <summary>
        /// Get CompareToEnum In Title
        /// </summary>
        /// <param name="orgLevelKey"></param>
        /// <param name="compareTo"></param>
        /// <param name="schoolType"></param>
        /// <param name="s4orALL"></param>
        /// <param name="regionString"></param>
        /// <returns></returns>
        public String GetCompareToInTitle(
            OrgLevel orgLevel,
            CompareTo compareTo,
            STYP schoolType,
            S4orALL s4orALL,
            string regionString)
        {
            StringBuilder sb = new StringBuilder();

            if (compareTo.Key == CompareToKeys.SelSchools ||
                compareTo.Key == CompareToKeys.SelDistricts)
            {
                if (s4orALL.Key == S4orALLKeys.AllSchoolsOrDistrictsIn)
                {
                    if (orgLevel.Key == OrgLevelKeys.School)
                    {
                        sb.AppendFormat(" Compared to All {0} in {1} ",
                                        SchoolTypeLabel(schoolType), regionString);
                    }
                    else if (orgLevel.Key == OrgLevelKeys.District)
                    {
                        sb.AppendFormat(" Compared to All Districts in {0} ", regionString);
                    }
                }
                else
                {
                    if (orgLevel.Key == OrgLevelKeys.School)
                    {
                        sb.AppendFormat(" Compared to Selected {0} ", SchoolTypeLabel(schoolType));
                    }
                    else if (orgLevel.Key == OrgLevelKeys.District)
                    {
                        sb.AppendFormat(" Compared to Selected Districts ");
                    }
                }
            }
            else
            {
                if (compareTo.Key == CompareToKeys.OrgLevel && orgLevel.Key == OrgLevelKeys.District)
                {
                    sb.AppendFormat(" Compared to {0} ", compareTo.Key.Replace("District/", String.Empty));
                }
                else if (compareTo.Key != CompareToKeys.Current)
                {
                    sb.AppendFormat(" Compared to {0} ", compareTo.Key);
                }
            }

            return(sb.ToString());
        }
예제 #6
0
        private List <string> MyGetFullKeysList(CompareTo compareTo, OrgLevel orgLevel, string origFullKey, List <string> compareToSchoolsOrDistrict)
        {
            string myOrigFullkey = origFullKey;

            if (OrgLevel.Key != OrgLevelKeys.School)
            {
                //On Post Grad Intent page, if org level == district, school level fullkey should not appear.
                if (FullKeyUtils.GetOrgLevelFromFullKeyX(origFullKey).Key == OrgLevelKeys.School)
                {
                    myOrigFullkey = FullKeyUtils.DistrictFullKey(origFullKey);
                }
            }
            return(FullKeyUtils.GetFullKeysList(compareTo, orgLevel, myOrigFullkey, compareToSchoolsOrDistrict, S4orALL));
        }
예제 #7
0
 protected virtual void GetViewByList(Group ViewBy,
                                      OrgLevel orgLevel,
                                      out List <int> sexCodes,
                                      out List <int> raceCodes,
                                      out List <int> disabilityCodes,
                                      out List <int> gradeCodes,
                                      out List <int> econDisadvCodes,
                                      out List <int> ELPCodes)
 {
     sexCodes        = new List <int>();
     raceCodes       = new List <int>();
     disabilityCodes = new List <int>();
     gradeCodes      = new List <int>();
     econDisadvCodes = new List <int>();
     ELPCodes        = new List <int>();
 }
        private List <string> MyGetFullKeysList(CompareTo compareTo, OrgLevel orgLevel, string origFullKey, List <string> compareToSchoolsOrDistrict)
        {
            List <string> retval = new List <string>();

            if (OrgLevel.Key == OrgLevelKeys.School)
            {
                //For Grad Requirements page:  school level data are not available.  Use District instead.
                string maskedFullKey = FullKeyUtils.DistrictFullKey(origFullKey);
                retval.Add(maskedFullKey);
            }
            else
            {
                retval = FullKeyUtils.GetFullKeysList(compareTo, orgLevel, origFullKey, compareToSchoolsOrDistrict, S4orALL);
            }

            return(retval);
        }
예제 #9
0
        public override List <string> GetVisibleColumns(Group viewBy, OrgLevel orgLevel, CompareTo compareTo, STYP schoolType)
        {
            List <string> cols = base.GetVisibleColumns(viewBy, orgLevel, compareTo, schoolType);

            if ((compareTo.Key == CompareToKeys.SelSchools) || (compareTo.Key == CompareToKeys.Current))
            {
                //When user selects "Compare To = Selected Schools" the first column in the grid
                //should show the school name, but with no header.
                cols.Add(_ds._v_DropoutsWWoDisEconELPSchoolDistState.NameColumn.ColumnName);
            }

            cols.Add(_ds._v_DropoutsWWoDisEconELPSchoolDistState.EnrollmentColumn.ColumnName);
            cols.Add(_ds._v_DropoutsWWoDisEconELPSchoolDistState.Students_expected_to_complete_the_school_termColumn.ColumnName);
            cols.Add(_ds._v_DropoutsWWoDisEconELPSchoolDistState.Students_who_completed_the_school_termColumn.ColumnName);
            cols.Add(_ds._v_DropoutsWWoDisEconELPSchoolDistState.Drop_OutsColumn.ColumnName);
            cols.Add(_ds._v_DropoutsWWoDisEconELPSchoolDistState.Drop_Out_RateColumn.ColumnName);

            return(cols);
        }
        protected List <string> MyGetFullKeysList(
            CompareTo compareTo, OrgLevel orgLevel, string origFullKey,
            List <string> compareToSchoolsOrDistrict)
        {
            List <string> retval = FullKeyUtils.GetFullKeysList(compareTo,
                                                                orgLevel, origFullKey, compareToSchoolsOrDistrict, S4orALL);

            if (this.OrgLevel.Key != OrgLevelKeys.School)
            {
                List <string> maskedVals = new List <string>();
                foreach (string fullkey in retval)
                {
                    string maskedVal = FullKeyUtils.GetMaskedFullkey(fullkey, this.OrgLevel);
                    maskedVals.Add(maskedVal);
                }
                retval = maskedVals;
            }

            return(retval);
        }
        public async Task <string> GetOrgLevel(string apikey, double version, string returntype)
        {
            try
            {
                if (version.Equals(ApiVersion))
                {
                    if (!string.IsNullOrEmpty(returntype) && ValidReturnTypes != null && ValidReturnTypes.Contains(returntype.ToLower()))
                    {
                        if (!string.IsNullOrEmpty(apikey) && apikey.Length == 32 && ApiKey == apikey)
                        {
                            if (!string.IsNullOrEmpty(ConnectionString))
                            {
                                var OrgLevels = OrgLevel.All(ApiConfiguration, ConnectionString);

                                var list = new List <OrgLevel>();
                                list.AddRange(OrgLevels);

                                return(await list.ToReturnType(returntype));
                            }
                            else
                            {
                                return(await Core.ToReturnType(new Response("Failed", "Something Wrong...."), returntype));
                            }
                        }
                        else
                        {
                            return(await Core.ToReturnType(new Response("Failed", "Invalid apikey"), returntype));
                        }
                    }
                    else
                    {
                        return(await Core.OutputText("Supported return types are json and xml only."));
                    }
                }
                else
                {
                    return(await Core.OutputText("Version not yet implemented"));
                }
            }
            catch (Exception ex) { return(await Core.ToReturnType(new Response("Failed", ex.Message), "json")); }
        }
        public static String GetMaskedFullkey(string origFullKey, String desiredOrgLevelKey)
        {
            string   retval       = origFullKey;
            OrgLevel origOrgLevel = FullKeyUtils.GetOrgLevelFromFullKeyX(origFullKey);

            if (desiredOrgLevelKey == OrgLevelKeys.School)
            {
                if ((origOrgLevel.Key == OrgLevelKeys.District) || (origOrgLevel.Key == OrgLevelKeys.State))
                {
                    //cannot create a school's fullkey from a District or State fullky.
                    retval = string.Empty;
                }

                //otherwise, continue using default value
            }
            else if (desiredOrgLevelKey == OrgLevelKeys.District)
            {
                if (origOrgLevel.Key == OrgLevelKeys.State)
                {
                    //cannot create s District fullkey given a State fullkey.
                    retval = string.Empty;
                }
                else
                {
                    //otherwise, replace the last 4 digits of the fullkey
                    //retval = origFullKey.Substring(0, 7) + "3XXXX"; //BR: shoulb be "3ZZZZ" for out going URL
                    //to fix Charter school issues
                    retval = origFullKey.Substring(0, 6) + "03XXXX"; //BR: shoulb be "03ZZZZ" for out going URL
                }
            }
            else
            {
                //orglevel == State
                retval = "XXXXXXXXXXXX"; //BR: shoulb be "ZZZZZZZZZZZZ" for out going URL 6/08
            }

            return(retval);
        }
        public static OrgLevel GetOrgLevelFromFullKeyX(string origFullKey)
        {
            OrgLevel orgLevel = new OrgLevel();

            if (!(origFullKey.Length == 12 || String.IsNullOrEmpty(origFullKey)))
            {
                throw new Exception("FullKey must be 12 characters long.");
            }
            else if (origFullKey.StartsWith("X") || String.IsNullOrEmpty(origFullKey))
            {
                orgLevel.Value = orgLevel.Range[OrgLevelKeys.State];
            }
            else if (origFullKey.Contains("X"))
            {
                orgLevel.Value = orgLevel.Range[OrgLevelKeys.District];
            }
            else
            {
                orgLevel.Value = orgLevel.Range[OrgLevelKeys.School];
            }

            return(orgLevel);
        }
        //Notes for graph

        /* public override string GetViewByColumnName()
         * {
         *   //There is no RaceShortLabel column in this page, so we need to use the Full paramName
         *   if (ViewBy.Key == GroupKeys.Race)
         *   {
         *       return "RaceLabel";
         *   }
         *   else
         *   {
         *       return base.GetViewByColumnName();
         *   }
         * }*/

        //Notes for graph

        /* public override string GetCompareToColumnName()
         * {
         *   if (CompareTo == CompareToEnum.DISTSTATE)
         *   {
         *       return "District paramName";
         *   }
         *   else
         *   {
         *       return base.GetCompareToColumnName();
         *   }
         * }*/


        private List <string> MyGetFullKeysList(
            CompareTo compareTo,
            OrgLevel orgLevel, string origFullKey,
            List <string> compareToSchoolsOrDistrict)
        {
            List <string> retval = new List <string>();


            if (OrgLevel.Key == OrgLevelKeys.School)
            {
                newOrigFullKey    = FullKeyUtils.DistrictFullKey(origFullKey);
                newOrgLevel.Value = newOrgLevel.Range[OrgLevelKeys.District];
                //convert each school into a district fullkey
                foreach (string fullkey in compareToSchoolsOrDistrict)
                {
                    string maskedFullkey = FullKeyUtils.GetMaskedFullkey(fullkey, OrgLevelKeys.District);
                    newCompareToSchools.Add(maskedFullkey);
                }
            }

            if (orgLevel.Key == OrgLevelKeys.District)
            {
                newOrgLevel         = orgLevel;
                newOrigFullKey      = origFullKey;
                newCompareToSchools = compareToSchoolsOrDistrict;
            }

            else if (orgLevel.Key == OrgLevelKeys.State)
            {
                newOrgLevel    = orgLevel;
                newOrigFullKey = FullKeyUtils.StateFullKey(origFullKey);
            }

            retval = FullKeyUtils.GetFullKeysList(compareTo, newOrgLevel, newOrigFullKey, newCompareToSchools, S4orALL);

            return(retval);
        }
        protected void HandleLinkControlAdded(HyperLinkPlus link)
        {
            OrgLevel ol = ((PageBaseWI)Page).GlobalValues.OrgLevel;

            if (link.ID == "linkCompareToSimSchools")
            {
                link.Visible = ShowSimilarSchoolsLink;
            }

            if (link.ID == "linkCompareToSelDistricts")
            {
                link.Visible = false; // hide by default, shown below...
            }
            if (ol.Key == OrgLevelKeys.State)
            {
                if (link.ID == "linkCompareToCurrent")
                {
                    link.Text = link.Text.Replace("School", "State");
                }

                if (//link.ID == "linkCompareToCurrent"
                    link.ID == "linkCompareToSelSchools"
                    | link.ID == "linkCompareToSimSchools"
                    | link.ID == "linkCompareToSelDistricts"
                    | link.ID == "linkCompareToOrgLevel")
                {
                    link.Enabled = false;
                }
            }
            else if (ol.Key == OrgLevelKeys.District)
            {
                //Note from Bug 379:
                //- Selected schools link - should say Selected Districts at district level
                if (link.ID == "linkCompareToSelSchools") //Bug 597:  Current District Data
                {
                    link.Visible = false;
                }
                else if (link.ID == "linkCompareToSelDistricts")
                {
                    link.Visible = true;
                }

                if (link.ID == "linkCompareToCurrent")
                {
                    link.Text = link.Text.Replace("School", "District");
                }

                if (link.ID == "linkCompareToOrgLevel")
                {
                    link.Text = link.Text.Replace("District/", "");
                }
                if (link.ID == "linkCompareToSimSchools")
                {
                    link.Text = link.Text.Replace("Schools", "Districts");
                }
            }
            else // OrgLevel = school - show SelSchools link, hide SelDistricts link
            {
                if (link.ID == "linkCompareToSelSchools") //Bug 597:  Current District Data
                {
                    link.Visible = true;
                }
                else if (link.ID == "linkCompareToSelDistricts")
                {
                    link.Visible = false;
                }
            }
        }
 public static String GetMaskedFullkey(String fullkey, OrgLevel orgLevel)
 {
     return(GetMaskedFullkey(fullkey, orgLevel.Key));
 }
예제 #17
0
        void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            string directoryName = Path.GetDirectoryName(ImageFile);
            string imageName     = Path.GetFileNameWithoutExtension(ImageFile);

            Directory.CreateDirectory(directoryName + "/" + imageName);

            int    width    = SourceImage.Width;
            int    height   = SourceImage.Height;
            int    size     = Math.Max(width, height);
            double numTiles = size / 256.0;

            for (int level = MinLevel; level <= MaxLevel; level++)
            {
                int logTileSize = (OrgLevel > level) ? 256 << (OrgLevel - level) : 256 >> (level - OrgLevel);
                int numTilesX   = (width % logTileSize == 0) ? width / logTileSize : width / logTileSize + 1;
                int numTilesY   = (height % logTileSize == 0) ? height / logTileSize : height / logTileSize + 1;

                for (int tx = 0; tx < numTilesX; tx++)
                {
                    for (int ty = 0; ty < numTilesY; ty++)
                    {
                        using (var tileImg = new Bitmap(256, 256))
                            using (var graphcis = Graphics.FromImage(tileImg))
                            {
                                graphcis.FillRectangle(new SolidBrush(BackgroundColor), 0, 0, 256, 256);
                                graphcis.DrawImage(SourceImage, new Rectangle(0, 0, 256, 256),
                                                   new Rectangle(tx * logTileSize, ty * logTileSize, logTileSize, logTileSize),
                                                   GraphicsUnit.Pixel);

                                tileImg.Save(string.Format("{0}/{1}/{2}-{3}-{4}.jpg", directoryName, imageName, level, tx, ty),
                                             System.Drawing.Imaging.ImageFormat.Jpeg);

                                bw.ReportProgress(0, new SendFeedbackEventArgs {
                                    Level = level, X = tx, Y = ty, Image = tileImg.Clone() as Bitmap
                                });
                            }
                    }
                }
            }

            string template;

            using (var reader = new StreamReader(Application.StartupPath + "\\Template.html"))
            {
                template = reader.ReadToEnd();
                reader.Close();
            }

            template = template.Replace("//image//", imageName);

            template = template.Replace("//width//", width.ToString());
            template = template.Replace("//height//", height.ToString());

            template = template.Replace("//maxLevel//", MaxLevel.ToString());
            template = template.Replace("//minLevel//", MinLevel.ToString());
            template = template.Replace("//orgLevel//", OrgLevel.ToString());

            template = template.Replace("//bgColor//", ColorTranslator.ToHtml(BackgroundColor));

            string htmlFile = directoryName + "/" + imageName + ".html";

            using (var writer = new StreamWriter(htmlFile))
            {
                writer.Write(template);
                writer.Close();
            }

            e.Result = htmlFile;
        }
예제 #18
0
        public static List <string> GetVisibleColumns(Group viewBy,
                                                      OrgLevel orgLevel,
                                                      CompareTo compareTo,
                                                      STYP schoolType)
        {
            ////Notes for graph : Can't reuse this function in graph, because the visible column is used in the Grade Display(Grade Column paramName)
            //the grap need the Data Set Column paramName, there is a little difference betwen theem. So can't reuse it in graph
            List <string> retval = new List <string>();

            Dictionary <String, String> map = new Dictionary <string, string>();

            map.Add(GroupKeys.Race, CommonNames.RaceLabel.ToString());
            map.Add(GroupKeys.Gender, CommonNames.SexLabel.ToString());
            map.Add(GroupKeys.Grade, CommonNames.GradeLabel.ToString());
            map.Add(GroupKeys.Disability, CommonNames.DisabilityLabel.ToString());
            map.Add(GroupKeys.EconDisadv, CommonNames.EconDisadvLabel.ToString());
            map.Add(GroupKeys.EngLangProf, CommonNames.ELPLabel.ToString());

            //not all values result in adding a column
            if (map.ContainsKey(viewBy.Key))
            {
                retval.Add(map[viewBy.Key]);
            }

            if (viewBy.Key == GroupKeys.RaceGender)
            {
                retval.Add(CommonNames.RaceLabel.ToString());
                retval.Add(CommonNames.SexLabel.ToString());
            }

            //Note that when "OrgLevel <> SC" and "Schooltype = 1 (all types)", we add
            //another column, SchooltypeLabel, to label the schooltype itemization...
            if ((orgLevel.Key != OrgLevelKeys.School) && (schoolType.Key == STYPKeys.AllTypes))
            {
                retval.Add(CommonNames.SchooltypeLabel.ToString());
            }

            if (compareTo.Key == CompareToKeys.OrgLevel)
            {
                if (orgLevel.Key != OrgLevelKeys.School && schoolType.Key == STYPKeys.AllTypes)
                {
                    retval.Add(CommonNames.OrgLevelLabel.ToString());
                }
                else
                {
                    retval.Add(CommonNames.OrgSchoolTypeLabel.ToString());
                }
            }

            if ((compareTo.Key == CompareToKeys.SelSchools || compareTo.Key == CompareToKeys.SelDistricts) || (compareTo.Key == CompareToKeys.Current))
            {
                //When user selects "Compare To = Selected Schools" the first column in the grid
                //should show the school name, but with no header.
                retval.Add(CommonNames.LinkedName.ToString());
            }

            //only show Year column when CompareToEnum == Prior Years
            if (compareTo.Key == CompareToKeys.Years)
            {
                retval.Add(CommonNames.YearFormatted.ToString());
            }

            return(retval);
        }