private void LoadSearchCriteria()
        {


            var searchCriteria = new Criteria();

            var demographicParms = new SearchParms();
            demographicParms.AddParm("", "");


            searchCriteria.Add(new Classes.Criterion()
            {
                Header = "Demographics",
                Key = "Demographics",
                Locked = true,
                Empty = true
                
            });

            searchCriteria.Add(new Classes.Criterion()
            {
                Header = "Demographics",
                Key = "Race",
                Removable = true

            });

            searchCriteria.Add(new Classes.Criterion()
            {
                Header = "Demographics",
                Key = "EOSL",
                Object = "Yes",
                Removable = true
            });

            searchCriteria.Add(new Classes.Criterion()
            {
                Header = "Demographics",
                Key = "Gifted",
                Object = "No",
                Removable = true
            });

            searchCriteria.Add(new Classes.Criterion()
            {
                Header = "Demographics",
                Key = "Special needs",
                Object = "Yes",
                Removable = true
            });

            SearchParms = new SearchParms();
            SearchParms.AddParm("reportCriteria", searchCriteria);

            var guid = System.Guid.NewGuid().ToString();
            hiddenTxtBox.Text = guid;
            Guid = guid;

            Session["Criteria_" + guid] = searchCriteria;
        }
        protected void SearchBtnClick(object sender, ImageClickEventArgs e)
        {
            var searchParms = new SearchParms();
            if (!String.IsNullOrEmpty(txtName.Text))
            {
                searchParms.AddParm("studentName", txtName.Text);
            }


        }
Пример #3
0
        private void LoadSearchCriteria()
        {

            var yearList = new List<string> { _year };
            var testList = new List<int> { _testId };

            var searchCriteria = new Criteria();

            var demographicParms = new SearchParms();
            demographicParms.AddParm(string.Empty, string.Empty);

            switch (_parent)
            {
                case "Class":
                    searchCriteria.Add(new Criterion
                    {
                        Header = "Class\\Group",
                        Locked = true,
                        Key = "Class",
                        Object = Base.Classes.Class.GetClassByID(DataIntegrity.ConvertToInt(_class)).ClassName,
                        ReportStringKey = "CID",
                        ReportStringVal = _class,
                        Type = "String",
                        Description = "Classes"
                    });

                    break;

                case "School":
                    var school = Base.Classes.School.GetSchoolByID(_parentId);

                    searchCriteria.Add(new Criterion
                    {
                        Header = "School",
                        Locked = true,
                        Key = "School",
                        Object = school.Name,
                        Type = "String"
                    });


                    break;

                case "Teacher":
                    searchCriteria.Add(new Criterion
                    {
                        Header = "Teacher",
                        Locked = true,
                        Key = "Teacher",
                        Object = TeacherDB.GetTeacherByPage(_parentId).TeacherName,
                        Type = "String"
                    });
                    break;
            }

            switch (_level)
            {
                case "Class":
                    searchCriteria.Add(new Criterion
                    {
                        Header = "Class\\Group",
                        Key = "Class",
                        Object = Base.Classes.Class.GetClassByID(DataIntegrity.ConvertToInt(_class)).ClassName,
                        ReportStringKey = "CID",
                        ReportStringVal = _levelId.ToString(CultureInfo.CurrentCulture),
                        Type = "String",
                        Description = "Classes",
                        Locked = false,
                        UIType = UIType.DropDownList,
                        DataSource = Base.Classes.Reports.GetReportingLevels(_level, _levelId, DataIntegrity.ConvertToInt(_parentId), testList, 0),
                        DataTextField = "Name",
                        DataValueField = "ID"
                    });

                    break;

                case "Student":
                    searchCriteria.Add(new Criterion
                    {
                        Header = "Student",
                        Locked = false,
                        Key = "Student",
                        Object = StudentDB.GetStudentByID(_levelId).StudentName,
                        Type = "String",
                        Description = "Classes",
                        UIType = UIType.DropDownList,
                        ReportStringKey = "StudentRecID",
                        ReportStringVal = _levelId.ToString(CultureInfo.CurrentCulture),
                        DataSource = Base.Classes.Reports.GetReportingLevels(_level, _levelId, DataIntegrity.ConvertToInt(_parentId), testList, 0),
                        DataTextField = "Name",
                        DataValueField = "ID"
                    });
                    break;

                case "Teacher":
                    searchCriteria.Add(new Criterion
                    {
                        Header = "Teacher",
                        Key = "Teacher",
                        Object = TeacherDB.GetTeacherByPage(_levelId).TeacherName,
                        ReportStringKey = "TEAID",
                        ReportStringVal = _levelId.ToString(CultureInfo.CurrentCulture),
                        Type = "String",
                        Locked = false,
                        UIType = UIType.DropDownList
                    });
                    break;
            }

            DataTable assessmentListDataTable = Base.Classes.Reports.GetTestList(_level, _levelId,
                DataIntegrity.ConvertToInt(_class), yearList, 0);

            searchCriteria.Add(new Criterion
            {
                Header = "Assessment",
                Locked = assessmentListDataTable.Rows.Count < 2,
                Key = "Assessment",
                Object = _testId == 0 ? "" : Assessment.GetAssessmentByID(_testId).TestName,
                Type = "String",
                ReportStringKey = "TID",
                ReportStringVal = _testId == 0 ? "" : _testId.ToString(CultureInfo.CurrentCulture),
                Description = "2010-2011",
                UIType = UIType.DropDownList,
                DataSource = assessmentListDataTable,
                DataTextField = "Name",
                DataValueField = "ID"
            });

            searchCriteria.Add(new Criterion
            {
                Header = "Type",
                Key = "Type",
                Object = _type,
                ReportStringKey = "TTYPES",
                ReportStringVal = _type,
                Type = "String",
                Description = "type",
                Locked = true
            });

            searchCriteria.Add(new Criterion
            {
                Header = "Year(s)",
                Key = "Year(s)",
                Object = _year,
                ReportStringKey = "TYRS",
                ReportStringVal = _year,
                Type = "String",
                Description = "2010-2011",
                Locked = true
            });

            searchCriteria.Add(new Criterion
            {
                Header = "Terms",
                Key = "Terms",
                Type = "String",
                ReportStringKey = "TTERMS",
                ReportStringVal = _term,
                Description = "List of terms",
                Object = _term,
                Locked = true
            });

            searchCriteria.Add(new Criterion
            {
                Header = "Demographics",
                Key = "Demographics",
                Locked = true,
                Empty = true
            });

            searchCriteria.Add(new Criterion
            {
                Header = "Groups",
                Key = "group",
                Object = _groups,
                ReportStringKey = "GRP",
                ReportStringVal = _groups,
                Type = "String",
                Description = "Groups Filter",
                Locked = true,
                UIType = UIType.DropDownList,
                DataSource = null,
                DataTextField = "DisplayName",
                DataValueField = "RoleId",
                Visible = false
            });

            SearchParms = new SearchParms();
            SearchParms.AddParm("reportCriteria", searchCriteria);

            var guid = Guid.NewGuid().ToString();
            hiddenTxtBox.Text = guid;

            Session["Criteria_" + guid] = searchCriteria;
        }
        private void LoadSearchCriteria()
        {
            _guid = Guid.NewGuid().ToString();
            hiddenTxtBox.Text = _guid;

            //Session["Criteria_" + _guid] = searchCriteria;
            return;
            var yearList = new List<string> { this._year };

            var searchCriteria = new Criteria();

            #region Criterion: Assessment

            var assessmentTypesTable = Thinkgate.Base.Classes.Reports.GetTestTypesForStateReporting();

            //CLEANUP: WSH - Need to strip out all of this old critiera stuff once the new fct and proficiency stuff is verified.

            /*
             * WSH: 8/20/12 - removed for Sarasota demo per meeting request - 
              var _assessmentType = (assessmentTypesTable.Rows.Count > 0) ? assessmentTypesTable.Rows[0]["Type"].ToString() : "";
                foreach (DataRow row in assessmentTypesTable.Rows)
            {
                if (row["Type"].ToString() == "FCAT2")
                {
                    _assessmentType = "FCAT2";
                    break;
                }
                
            }
              */

            searchCriteria.Add(new Criterion()
            {
                Header = "Assessment",
                Locked = false,
                Key = "TestType",
                Object = "",
                Type = "String",
                ReportStringKey = "TID",
                ReportStringVal = "",
                UIType = UIType.DropDownList,
                DataSource = assessmentTypesTable,
                DataTextField = "Type",
                DataValueField = "Type",
                IsRequired = true/*,
                DefaultValue = _assessmentType*/
            });

            #endregion

            #region Criterion: Year

            var yearsTable = Thinkgate.Base.Classes.Reports.GetYearsForStateReporting();
            // WSH: 8/20/12 - removed for Sarasota demo per meeting request - if (yearsTable.Rows.Count > 0) _year = yearsTable.Rows[0]["Year"].ToString();
            searchCriteria.Add(new Classes.Criterion()
            {
                Key = "Year",
                Header = "Year",
                Type = "String",
                Removable = true,
                Locked = false,
                IsHeader = true,
                DataTextField = "Year",
                DataValueField = "Year",
                UIType = UIType.DropDownList,
                DataSource = yearsTable,/*
                DefaultValue = _year,*/
                IsRequired = true,
                ServiceUrl = ResolveUrl("~/Services/GradeSubjectCourse.svc/GetTeachersBySchools"),
                ServiceOnSuccess = "getTeachers",
                Dependencies = new[]
                {
                    Criterion.CreateDependency("Grade", "Grades"),
                    Criterion.CreateDependency("School", "Schools"),
                    Criterion.CreateDependency("Teacher", "Teachers"),
                    Criterion.CreateDependency("Year", "Years")
                }
            });

            #endregion

            #region Criterion: Grade
            searchCriteria.Add(new Criterion
            {
                Header = "Grade",
                Key = "Grade",
                Type = "String",
                Description = string.Empty,
                Locked = false,
                DataSource = Thinkgate.Base.Classes.Reports.GetGradesForStateReporting(),
                UIType = UIType.DropDownList,
                Removable = true,
                IsRequired = true,
                ServiceUrl = ResolveUrl("~/Services/GradeSubjectCourse.svc/GetSchoolsAndTeachersByGrade"),
                ServiceOnSuccess = "getSchoolsAndTeachers",
                Dependencies = new[]
                {
                    Criterion.CreateDependency("Grade", "Grades"),
                    Criterion.CreateDependency("School", "Schools"),
                    Criterion.CreateDependency("Teacher", "Teachers"),
                    Criterion.CreateDependency("Year", "Years")
                }
            });

            #endregion

            #region Criterion: Subject

            searchCriteria.Add(new Criterion
            {
                Header = "Subject",
                Key = "Subject",
                Type = "String",
                Description = string.Empty,
                Locked = false,
                DataTextField = "Subject",
                DataValueField = "Subject",
                Removable = true,
                DataSource = Thinkgate.Base.Classes.Reports.GetSubjectsForStateReporting(),
                UIType = UIType.DropDownList,
                IsRequired = true
            });
            #endregion

            #region Criterion: School
            var schoolDataTable = new System.Data.DataTable();
            var schoolsForLoggedInUser = SchoolMasterList.GetSchoolsForUser(SessionObject.LoggedInUser);
            schoolsForLoggedInUser = schoolsForLoggedInUser.FindAll(s => s.Grades.IndexOf("03") > -1);
            schoolDataTable.Columns.Add("Name");
            schoolDataTable.Columns.Add("ID");

            foreach (var s in schoolsForLoggedInUser)
            {
                schoolDataTable.Rows.Add(s.Name, s.ID);
            }

            searchCriteria.Add(new Criterion
            {
                Header = "School",
                Key = "School",
                Type = "String",
                Description = string.Empty,
                Locked = false,
                DataTextField = "Name",
                DataValueField = "ID",
                Removable = true,
                DataSource = schoolDataTable,
                UIType = UIType.DropDownList,
                ServiceUrl = ResolveUrl("~/Services/GradeSubjectCourse.svc/GetTeachersBySchools"),
                ServiceOnSuccess = "getTeachers",
                Dependencies = new[]
                {
                    Criterion.CreateDependency("Grade", "Grades"),
                    Criterion.CreateDependency("School", "Schools"),
                    Criterion.CreateDependency("Teacher", "Teachers"),
                    Criterion.CreateDependency("Year", "Years")
                }
            });

            #endregion

            #region Criterion: Teacher

            var teachers = new System.Data.DataTable();//Base.Classes.Teacher.GetTeachersBySchoolsDT(schoolsForLoggedInUser.Select(s => s.ID).ToList());
            teachers.Columns.Add("ID");
            teachers.Columns.Add("TeacherName");

            searchCriteria.Add(new Criterion
            {
                Header = "Teacher",
                Key = "Teacher",
                Type = "String",
                Description = string.Empty,
                Locked = false,
                DataTextField = "TeacherName",
                DataValueField = "ID",
                Removable = true,
                DataSource = teachers,
                UIType = UIType.DropDownList

            });

            #endregion

            #region Criterion: Class
            var classCourseList = Thinkgate.Base.Classes.CourseMasterList.GetClassCoursesForUser(SessionObject.LoggedInUser);
            List<Int32> schoolIDs = new List<int>();
            schoolIDs.Add(0);
            var classesForLooggedInUser = Thinkgate.Base.Classes.Class.SearchClasses(classCourseList, null, schoolIDs, "");

            searchCriteria.Add(new Criterion
            {
                Header = "Class",
                Key = "Class",
                Type = "String",
                Description = string.Empty,
                Locked = false,
                DataTextField = "ClassName",
                DataValueField = "ClassID",
                Removable = true,
                DataSource = classesForLooggedInUser,
                UIType = UIType.DropDownList
            });
            #endregion

            #region Criterion: Demographics
            searchCriteria.Add(new Criterion()
            {
                Header = "Demographics",
                Key = "Demographics",
                Type = "String",
                Description = string.Empty,
                Locked = false,
                UIType = UIType.Demographics
            });

            #endregion

            SearchParms = new SearchParms();
            SearchParms.AddParm("reportCriteria", searchCriteria);

            _guid = Guid.NewGuid().ToString();
            hiddenTxtBox.Text = _guid;

            Session["Criteria_" + _guid] = searchCriteria;
        }