protected void Page_Load(object sender, EventArgs e)
        {
            #region Check Login
            CheckSchoolAdminSession();
            #endregion Check Login

            //add your value retrieve and form post code below
            #region Initialize Values and Form Execution
            #region Customize and Exporting
            strExpType = (CCLib.Common.Strings.GetFormString("exporttype") == "") ? "" : CCLib.Common.Strings.GetFormString("exporttype");

            if (CCLib.Common.Strings.GetQueryString("View") != "")
                Session["ReportSavedCriteriaID"] = CCLib.Common.Strings.GetQueryString("View");

            StringBuilder sbSQL = new StringBuilder();
            if (Session["ReportTempCriteriaID"] != null || Session["ReportSavedCriteriaID"] != null)
            {
                if (Session["ReportTempCriteriaID"] != null)
                    hTable = CCLib.Common.Forms.GetCriteriaData("Port_ReportsSavedSnap", Session["ReportTempCriteriaID"].ToString(), 1);
                if (Session["ReportSavedCriteriaID"] != null)
                    hTable = CCLib.Common.Forms.GetCriteriaData("Port_ReportsSavedSchool", Session["ReportSavedCriteriaID"].ToString(), 2);

                #region Get Customization criteria
                string strGradeID = hTable["GradeID"].ToString();
                string strGenderID = hTable["GenderID"].ToString();
                string strAdvisorID = hTable["AdvisorID"].ToString();
                string strEthnicityID = hTable["EthnicityID"].ToString();
                string strDatabaseName = "careerdb" + hTable["AcademicYear"].ToString() + ".dbo.";

                //Delaware criteria
                string strSPED = hTable["SpecialDE"].ToString();
                string sCTE = hTable["CTE_DE"].ToString().ToUpper();
                string sESL = hTable["LEP_DE"].ToString().ToUpper();
                if (sESL != "") sESL = sESL.Substring(0, 1);
                if (sCTE != "") sCTE = sCTE.Substring(0, 1);
                string strEthnicityDE = hTable["EthnicityDE"].ToString();
                #endregion Get Customization criteria

                sbSQL.Append(" SELECT DISTINCT p.PortfolioID,");
                sbSQL.Append(" cast(p.lastName as varchar) + N', ' + cast(p.firstName as varchar) as Name,");
                sbSQL.Append(" count(*) as AppTotal,");
                sbSQL.Append(" count(case when app.ScholStatusID = 4 then 1 when app.ScholStatusID = 6 then 1 when app.ScholStatusID = 7 then 1 else null end) as AppSubmitted,");
                sbSQL.Append(" count(case when app.ScholStatusID = 6 then 1 else null end) as AwardsReceived,");
                sbSQL.Append(" sum(app.AmountAwarded) as AmountAwarded");
                // From
                sbSQL.Append(" FROM " + strDatabaseName + "App_Scholprograms as app");
                sbSQL.Append(" JOIN " + strDatabaseName + "Portfolio as p on app.PortfolioID = p.PortfolioID");
                #region Specipic tables: PortTypeElements / Customization criteria
                // 1. Delaware criteria: PortTypeID == "3"
                if (PortTypeID == "3")
                {
                    sbSQL.Append(" JOIN " + strDatabaseName + "Port_Student_DE as t ON p.PortfolioID = t.PortfolioID ");
                    if (strEthnicityDE != "")
                    {
                        sbSQL.Append(" and t.Ethnic_Code=" + strEthnicityDE);
                    }
                    if (sESL == "Y") { sbSQL.Append(" and t.ESL like '%" + sESL + "%'"); }
                    if (sESL == "N") { sbSQL.Append(" and t.ESL not like '%Y%'"); }
                    if (sCTE == "Y") { sbSQL.Append(" and t.CTE like '%" + sCTE + "%'"); }
                    if (sCTE == "N") { sbSQL.Append(" and t.CTE not like '%Y%'"); }
                    if ((strSPED.ToUpper() != "NO") && (strSPED != "")) { sbSQL.Append(" and t.SPED not like '%NO%'"); }
                    if (strSPED.ToUpper() == "NO") { sbSQL.Append(" and t.SPED like '%NO%'"); }
                }
                // 2. Customization criteria: EthnicityID
                if (strEthnicityID != "")
                {
                    sbSQL.Append(" join " + strDatabaseName + "Port_Student_KY as s on s.PortfolioID = p.PortfolioID");
                    sbSQL.Append(" and s.Ethnicity = " + strEthnicityID);
                }
                // 3. Customization criteria: Advisor
                if (strAdvisorID != "")
                    sbSQL.Append(" join " + strDatabaseName + "PortfolioAdvisorAssignments as a on a.PortfolioID = p.PortfolioID and a.AdminID = " + strAdvisorID);
                #endregion Specipic tables: PortTypeElements / Customization criteria
                // Where
                #region Specipic conditions: PortTypeElements / Customization criteria
                // 1. Students at that CAMS user's school, students who are active and we only keep scholarships which are active
                sbSQL.Append(" WHERE p.SchoolID=" + AdminInfo["SchoolID"].ToString() + " and p.Active=1 and app.ScholActive=1");
                // 2. Students assigned to
                if (Convert.ToBoolean(PortTypeElements["App_AssignedOnly"]))
                    sbSQL.Append(" AND p.PortfolioID IN (select PortfolioID from PortfolioAdvisorAssignments where AdminID = " + AdminInfo["AdminID"].ToString() + " and AssignmentApproved=1)");
                // 3. Customization criteria: Grade Level
                if (strGradeID != "")
                    sbSQL.Append(" and p.GradeNumber = " + strGradeID);
                // 4. Customization criteria: Gender
                if (strGenderID != "")
                {
                    strGenderID = (strGenderID == "True") ? "1" : "0";
                    sbSQL.Append(" and p.GenderID = " + strGenderID);
                }
                #endregion Specipic conditions: PortTypeElements / Customization criteria
                sbSQL.Append(" GROUP BY p.PortfolioID, p.lastName, p.firstName");
               // sbSQL.Append(" ORDER BY " + RepeaterSortExpression + ASCENDING);
            }
            else
            {
                sbSQL.Append(" SELECT DISTINCT p.PortfolioID,");
                sbSQL.Append(" cast(p.lastName as varchar) + N', ' + cast(p.firstName as varchar) as Name,");
                sbSQL.Append(" count(*) as AppTotal,");
                sbSQL.Append(" count(case when ScholStatusID = 4 then 1 when ScholStatusID = 6 then 1 when ScholStatusID = 7 then 1 else null end) as AppSubmitted,");
                sbSQL.Append(" count(case when ScholStatusID =6 then 1 else null end) as AwardsReceived,");
                sbSQL.Append(" sum(AmountAwarded) as AmountAwarded");
                sbSQL.Append(" FROM App_Scholprograms AS app");
                sbSQL.Append(" JOIN Portfolio as p on app.PortfolioID = p.PortfolioID");
                // WHERE
                // 1. Students at that CAMS user's school, students who are active and we only keep scholarships which are active
                sbSQL.Append(" WHERE p.SchoolID=" + AdminInfo["SchoolID"].ToString() + " and p.Active=1 and app.ScholActive=1");
                // 2. Students assigned to
                if (Convert.ToBoolean(PortTypeElements["App_AssignedOnly"]))
                    sbSQL.Append(" AND p.PortfolioID in (select PortfolioID from PortfolioAdvisorAssignments where AdminID = " + AdminInfo["AdminID"].ToString() + " and AssignmentApproved=1)");
                sbSQL.Append(" GROUP BY p.PortfolioID, p.lastName, p.firstName");
               // sbSQL.Append(" ORDER BY " + RepeaterSortExpression + ASCENDING);
            }
            dtTables = CCLib.Common.DataAccess.GetDataTables(sbSQL.ToString());
            //Response.Write(sbSQL.ToString());
            sbSQL = null;
            #endregion Customize and Exporting

            #region Paging.
            DelMethodReloadChart delReloadChart = new DelMethodReloadChart(ReloadChart);
            this.pc1.PageMethodReloadChart = this.pc2.PageMethodReloadChart = delReloadChart;
            this.pc1.MaxRecordsPage = this.pc2.MaxRecordsPage = MAX_RECORDS_BY_PAGE;
            this.pc1.DisplayTotalItems = this.pc2.DisplayTotalItems = false;
            #endregion Paging.

            PopulateRptStud();

            #endregion Initialize Values and Form Execution

            #region Customize Export User Control
            UC.BaseReportID = "77";
            UC.PortTypeID = PortTypeID;
            UC.ToolTypeID = ToolTypeID;
            if (hTable != null)
            {
                UC.CriteriaHashtable = hTable;
                if (hTable["ReportName"] != null)
                    UC.ReportName = hTable["ReportName"].ToString();
            }
            UC.ReportData = dtTables;
            UC.ReportTitles = TextCode(10662);
            UC.ReportDataColumnNames = TextCode(8905) + "," + TextCode(10667) + "," + TextCode(10617) + "," + TextCode(10668) + "," + TextCode(10463);
            UC.ReportDataFieldNames = "Name,AppTotal,AppSubmitted,AwardsReceived,AmountAwarded";
            #endregion Customize Export User Control

            #region Properties For The School Base Class
            TitleBar = "Application Planner Reports";
            SubTitleBar = TextCode(10662);
            StrictNoCache = false;
            #endregion Properties For The School Base Class
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Check Login
            CheckSchoolAdminSession();
            #endregion Check Login

            #region Init Paging user control.
            DelMethodReloadChart delReloadChart = new DelMethodReloadChart(ReloadChart);
            this.pc1.PageMethodReloadChart = this.pc2.PageMethodReloadChart = delReloadChart;
            this.pc1.MaxRecordsPage = this.pc2.MaxRecordsPage = MAX_RECORDS_BY_PAGE;
            this.pc1.DisplayTotalItems = this.pc2.DisplayTotalItems = false;
            #endregion Init Paging user control.

            //add your value retrieve and form post code below
            #region Initialize Values and Form Execution
            strExpType = (CCLib.Common.Strings.GetFormString("exporttype") == "") ? "" : CCLib.Common.Strings.GetFormString("exporttype");

            if (CCLib.Common.Strings.GetQueryString("View") != "")
                Session["ReportSavedCriteriaID"] = CCLib.Common.Strings.GetQueryString("View");

            if (Session["ReportTempCriteriaID"] != null || Session["ReportSavedCriteriaID"] != null)
            {
                if (Session["ReportTempCriteriaID"] != null)
                    hTable = CCLib.Common.Forms.GetCriteriaData("Port_ReportsSavedSnap", Session["ReportTempCriteriaID"].ToString(), 1);
                if (Session["ReportSavedCriteriaID"] != null)
                    hTable = CCLib.Common.Forms.GetCriteriaData("Port_ReportsSavedSchool", Session["ReportSavedCriteriaID"].ToString(), 2);
            }

            bindData();
            #endregion Initialize Values and Form Execution

            #region Customize Export User Control
            UC.BaseReportID = "83";
            UC.PortTypeID = PortTypeID;
            UC.ToolTypeID = ToolTypeID;
            if (hTable != null)
            {
                UC.CriteriaHashtable = hTable;
                if (hTable["ReportName"] != null)
                    UC.ReportName = hTable["ReportName"].ToString();
            }
            UC.ReportData = dtTables;
            UC.ReportTitles = "Personal College Profiles";
            UC.ReportDataColumnNames = "Student Name,Grade,Questions Answered";
            UC.ReportDataFieldNames = "Name,Grade,QuesAnswered";
            #endregion Customize Export User Control

            #region Properties For The School Base Class
            TitleBar = "Application Planner Reports";
            SubTitleBar = "Personal College Profiles";
            StrictNoCache = false;
            #endregion Properties For The School Base Class
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            #region Check Login
            CheckRegionAdminSession();
            #endregion Check Login
            // Allow users to use the "Back Button" in the browser to come back to this page
            StrictNoCache = false;

            #region Paging.
            DelMethodReloadChart delReloadChart = new DelMethodReloadChart(ReloadChart);
            this.pc1.PageMethodReloadChart = this.pc2.PageMethodReloadChart = delReloadChart;
            this.pc1.MaxRecordsPage = this.pc2.MaxRecordsPage = MAX_RECORDS_BY_PAGE;
            this.pc1.DisplayTotalItems = this.pc2.DisplayTotalItems = true;
            #endregion Paging.

            //add your value retrieve and form post code below
            #region Initialize Values and Form Execution
            strExpType = CareerCruisingWeb.CCLib.Common.Strings.GetFormString("exporttype");

            if (!IsPostBack)
            {
                // User comes from the search page: search criteria retrieve (7)
                // or from the details page: keep the previous search criteria
                // http://msdn.microsoft.com/en-us/library/ms178139.aspx#Y684
                if (Page.PreviousPage != null)
                {
                    if (Page.PreviousPage.ToString().EndsWith("studentssearch_aspx"))
                    {
                        if (CCLib.Common.Strings.GetFormString("ddlSchool") != "")
                            strSearchCriteria += " AND p.SchoolID=" + CCLib.Common.Strings.GetFormString("ddlSchool");
                        if (CCLib.Common.Strings.GetFormString("ddlGrade") != "")
                        {
                            if (CCLib.Common.Strings.GetFormString("ddlGrade") != "13")
                                strSearchCriteria += " and p.GradeNumber=" + CCLib.Common.Strings.GetFormString("ddlGrade");
                            else
                                strSearchCriteria += " and p.GradeNumber not in (6,7,8,9,10,11,12)";
                        }
                        if (CCLib.Common.Strings.GetFormString("txtUsername") != "")
                            strSearchCriteria += " AND p.Username like '" + CCLib.Common.Strings.FormatUserInput(CCLib.Common.Strings.GetFormString("txtUsername"), false) + "%'";
                        if (CCLib.Common.Strings.GetFormString("txtFirstName") != "")
                            strSearchCriteria += " AND p.FirstName like '" + CCLib.Common.Strings.FormatUserInput(CCLib.Common.Strings.GetFormString("txtFirstName"), false) + "%'";
                        if (CCLib.Common.Strings.GetFormString("txtLastName") != "")
                            strSearchCriteria += " AND p.LastName like '" + CCLib.Common.Strings.FormatUserInput(CCLib.Common.Strings.GetFormString("txtLastName"), false) + "%'";
                        if (CCLib.Common.Strings.GetFormString("rdGender") != "")
                            strSearchCriteria += " AND p.Gender='" + CCLib.Common.Strings.GetFormString("rdGender") + "'";

                        Session["CurrentSearchCriteria"] = strSearchCriteria;
                    }
                }
                // User comes from left menu
                else
                    Session["CurrentSearchCriteria"] = "";

                PopulateRptSchol(RepeaterSortExpression, ASCENDING);
            }
            #endregion Initialize Values and Form Execution

            #region Properties For The Region Base Class
            TitleBar = TextCode(10543);
            HasLeftButtons = false;
            HasRightMenuCorner = false;
            HasSubTitleBar = false;
            #endregion Properties For The Region Base Class
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Check Login
            CheckRegionAdminSession();
            #endregion Check Login

            #region Initialize Paging
            DelMethodReloadChart delReloadChart = new DelMethodReloadChart(ReloadChart);
            this.pagingControlTop.PageMethodReloadChart = this.pagingControlBottom.PageMethodReloadChart = delReloadChart;
            this.pagingControlTop.MaxRecordsPage = this.pagingControlBottom.MaxRecordsPage = intPageSize;
            this.pagingControlTop.DisplayTotalItems = this.pagingControlBottom.DisplayTotalItems = true;
            #endregion Initialize Paging.

            #region Initialize Values and Form Execution
            strExpType = CCLib.Common.Strings.GetFormString("exporttype");
            if (!Page.IsPostBack)
            {
                ViewState["sortExp"] = "StudentName, CollegeName";
                ViewState["sortOrder"] = "desc";
                ViewState["pageNumner"] = "1";

                // per requested, same search criteria section as it's in the Scholarship Tracker Overview page
                if (Page.PreviousPage != null)
                {
                    if (Page.PreviousPage.ToString().EndsWith("studentssearch_aspx"))
                    {
                        string strSearchCriteria = "";
                        if (CCLib.Common.Strings.GetFormString("ddlGrade") != "")
                        {
                            if (CCLib.Common.Strings.GetFormString("ddlGrade") != "13")
                                strSearchCriteria += " and p.GradeNumber=" + CCLib.Common.Strings.GetFormString("ddlGrade");
                            else
                                strSearchCriteria += " and p.GradeNumber not in (6,7,8,9,10,11,12)";
                        }
                        if (CCLib.Common.Strings.GetFormString("txtUsername") != "")
                            strSearchCriteria += " and p.Username like '" + CCLib.Common.Strings.FormatUserInput(CCLib.Common.Strings.GetFormString("txtUsername"), false) + "%'";
                        if (CCLib.Common.Strings.GetFormString("txtFirstName") != "")
                            strSearchCriteria += " and p.FirstName like '" + CCLib.Common.Strings.FormatUserInput(CCLib.Common.Strings.GetFormString("txtFirstName"), false) + "%'";
                        if (CCLib.Common.Strings.GetFormString("txtLastName") != "")
                            strSearchCriteria += " and p.LastName like '" + CCLib.Common.Strings.FormatUserInput(CCLib.Common.Strings.GetFormString("txtLastName"), false) + "%'";
                        if (CCLib.Common.Strings.GetFormString("ddlAdvisor") != "")
                            strSearchCriteria += " and p.PortfolioID in (select portfolioid from PortfolioAdvisorAssignmentView where Adminid=" + CCLib.Common.Strings.GetFormString("ddlAdvisor") + ")";
                        if (CCLib.Common.Strings.GetFormString("rdGender") != "")
                            strSearchCriteria += " and p.Gender='" + CCLib.Common.Strings.GetFormString("rdGender") + "'";
                        if (CCLib.Common.Strings.GetFormString("ddlGroup") != "")
                        {
                            ViewState["InGroup"] = true;
                            strSearchCriteria += " and g.GroupID=" + CCLib.Common.Strings.GetFormString("ddlGroup");
                        }
                        else ViewState["InGroup"] = false;
                        ViewState["SearchCriteria"] = strSearchCriteria;
                    }
                }
                else ViewState["SearchCriteria"] = "";

                bindData(ViewState["sortExp"].ToString(), ViewState["sortOrder"].ToString());
            }
            #endregion Initialize Values and Form Execution

            #region Properties For The Region Base Class
            TitleBar = "College Application Status";
            HasSubTitleBar = false;
            HasLeftButtons = false;
            HasRightMenuCorner = false;
            StrictNoCache = false;
            #endregion Properties For The Region Base Class
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Check Login
            CheckRegionAdminSession();
            #endregion Check Login

            #region Init Paging user control.
            DelMethodReloadChart delReloadChart = new DelMethodReloadChart(ReloadChart);
            this.pc1.PageMethodReloadChart = this.pc2.PageMethodReloadChart = delReloadChart;
            this.pc1.MaxRecordsPage = this.pc2.MaxRecordsPage = MAX_RECORDS_BY_PAGE;
            this.pc1.DisplayTotalItems = this.pc2.DisplayTotalItems = false;
            #endregion Init Paging user control.

            //add your value retrieve and form post code below
            #region Initialize Values and Form Execution
            strExpType = (CCLib.Common.Strings.GetFormString("exporttype") == "") ? "" : CCLib.Common.Strings.GetFormString("exporttype");

            dtStatus = CCLib.Common.DataAccess.GetDataTable("SELECT * FROM App_ChecklistStatus_Lookup WHERE ItemTypeID=" + strItemTypeID);

            if (CCLib.Common.Strings.GetQueryString("View") != "")
                Session["ReportSavedCriteriaID"] = CCLib.Common.Strings.GetQueryString("View");

            if (Session["ReportTempCriteriaID"] != null || Session["ReportSavedCriteriaID"] != null)
            {
                if (Session["ReportTempCriteriaID"] != null)
                    hTable = CCLib.Common.Forms.GetCriteriaData("Port_ReportsSavedSnap", Session["ReportTempCriteriaID"].ToString(), 1);
                if (Session["ReportSavedCriteriaID"] != null)
                    hTable = CCLib.Common.Forms.GetCriteriaData("Port_ReportsSavedRegion", Session["ReportSavedCriteriaID"].ToString(), 2);
            }

            bindData();
            #endregion Initialize Values and Form Execution

            #region Customize Export User Control
            UC.BaseReportID = "92";
            UC.PortTypeID = PortTypeID;
            UC.ToolTypeID = ToolTypeID;
            if (hTable != null)
            {
                UC.CriteriaHashtable = hTable;
                if (hTable["ReportName"] != null)
                    UC.ReportName = hTable["ReportName"].ToString();
            }
            UC.ReportData = dtTables;
            UC.ReportTitles = "CSS PROFILE Planning by Student";
            UC.ReportDataColumnNames = "School Name,Student Name,Grade,Applying,Status";
            UC.ReportDataFieldNames = "InstitutionName,Name,Grade,Applying,Status";
            #endregion Customize Export User Control

            #region Properties For The Region Base Class
            TitleBar = "Application Planner Reports";
            SubTitleBar = "CSS PROFILE Planning by Student";
            StrictNoCache = false;
            #endregion Properties For The Region Base Class
        }