private async Task LoadingAsync() { try { //1.查询课表 //2.检查是否有临近的课,如果有去预约会议号 //3.获取列表数据 var classroomId = GlobalData.Instance.Classroom.Id; var classTable = await _bmsService.GetClassTableInfoAsync(classroomId); //DoUpdateCurriculumMeetingN0(classTable); GetWeekCourse(classTable); if (!CourseList.Any(o => o.IsProcessing)) { _s.Keyboard.KeyPress(VirtualKeyCode.TAB); _s.Keyboard.KeyPress(VirtualKeyCode.TAB); } DeviceSettingsChecker.Instance.IsVideoAudioSettingsValid(_scheduleView); } catch (Exception ex) { Log.Logger.Error($"课表加载信息发生异常 exception:{ex}"); MessageQueueManager.Instance.AddError(MessageManager.LoadingError); } }
private void button1_Click(object sender, EventArgs e) { LessonSchool lesson = new LessonSchool(); // bool check= ValidateForm(); // if (check == true) // { string nameNew = LessonsName.Text; string nameEx = LessonsList.GetItemText(LessonsList.SelectedItem); string date = DateTbx.Text; string time = TimeTbx.Text; // var date = DateTime.ParseExact(dateS, "yyyyMMdd", null); //DateTime date = DateTime.Parse(DateTbx.Text); //DateTime time = DateTime.Parse(TimeTbx.Text); string groupName = GroupList.GetItemText(GroupList.SelectedItem); string courseName = CourseList.GetItemText(CourseList.SelectedItem); string roomName = RoomList.GetItemText(RoomList.SelectedItem); if (choose == 2) { ValidateForm(); string text = lesson.addNewLesson(nameNew, date, time, courseName, groupName, roomName); MessageBox.Show(text); } if (choose == 1) { ValidateForm(); string text = lesson.changeLesson(nameEx, date, time, courseName, groupName, roomName); MessageBox.Show(text); } //} }
async Task ExecuteLoadItemsCommand() { if (IsBusy) { return; } IsBusy = true; try { CourseList.Clear(); var items = await App.Database.GetCoursesAsync(Term); foreach (var item in items) { CourseList.Add(item); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
/// <summary> /// 获取一周课表 /// </summary> /// <param name="classTable"></param> private void GetWeekCourse(ClassTable classTable) { if (classTable == null || classTable.ClassTableItems == null) { return; } CourseViewList.Clear(); CourseList.Clear(); for (var i = 1; i < 6; i++) { for (var j = 1; j < 9; j++) { var course = new Course() { CurriculumNumber = j, WeekId = i, CourseName = "-" }; var exsitCourse = classTable.ClassTableItems.FirstOrDefault(o => o.CurriculumNumber == j && o.WeekId == i); CourseList.Add(exsitCourse ?? course); } } for (var i = 1; i < 9; i++) { var cvm = GetCourseView(i); CourseViewList.Add(cvm); } }
public string Get(int id) { //The obtained id is the school ID // The model contains courses objects to store their attributes var model = new CourseList { Courses = new List <Course>() }; var query = "select Course.CourseNumber, Course.Title, Course.CourseID from Course" + " join AdmissionRequiredCourses on AdmissionRequiredCourses.CourseID = Course.CourseID" + $" where SchoolID = {id}"; var connection = new DBConnection(); //The query after executing returns a datatable var results = connection.ExecuteToDT(query); //Iterating through every row which is a course data object foreach (DataRow row in results.Rows) { var courseID = ((int)row["CourseID"]).ToString(); var title = row["Title"].ToString(); var description = row["CourseNumber"].ToString(); model.Courses.Add(new Course { Description = description, Id = courseID, Title = title }); } //The model holds the attributes of the course dataobjects retrieved and stored in it var response = JsonConvert.SerializeObject(model); return(response); }
public ActionResult Create([Bind(Include = "Id,CourseId,StudentId,Durtation,StartDate,EndDate,HolidayStartDay,HolidayEndDate")] CourseList courseList) { var dates = db.CorsesList.Where(cl => cl.StudentId == courseList.StudentId).Select(x => new { x.StartDate, x.EndDate }).ToList(); bool isValid = true; if (dates != null) { dates.ForEach(date => { if (courseList.StartDate < date.EndDate && date.StartDate < courseList.EndDate) { isValid = false; } }); } if (isValid == false) { ViewBag.ErroMessage = "You have course on this dates. Choose another!"; ViewBag.CourseId = new SelectList(db.Corses, "Id", "CourseName", courseList.CourseId); ViewBag.StudentId = new SelectList(db.Students, "Id", "FullName", courseList.StudentId); return(View(courseList)); } if (ModelState.IsValid) { db.CorsesList.Add(courseList); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CourseId = new SelectList(db.Corses, "Id", "CourseName", courseList.CourseId); ViewBag.StudentId = new SelectList(db.Students, "Id", "FullName", courseList.StudentId); return(View(courseList)); }
protected new void Page_Init(object sender, EventArgs e) { base.Page_Init(sender, e); if (!IsPostBack) { _userID = SessionObject.LoggedInUser.Page; _standardCourseList = CourseMasterList.GetStandardCoursesForUser(SessionObject.LoggedInUser); _standardSets = Thinkgate.Base.Classes.Standards.GetStandardSets(SessionObject.GlobalInputs, _userID); _gradeList = _standardCourseList.GetGradeList(); _subjectList = _standardCourseList.GetSubjectList(); } _filterName = Request.QueryString["filterName"]; _standardsFilterDataTable = new DataTable(); foreach (DataColumn col in Thinkgate.Base.Classes.Standards.TableStructure.Columns) { DataColumn newCol = new DataColumn(col.ColumnName); _standardsFilterDataTable.Columns.Add(newCol); } _standardsSearchDataTable = new DataTable(); foreach (DataColumn col in Thinkgate.Base.Classes.Standards.TableStructure.Columns) { DataColumn newCol = new DataColumn(col.ColumnName); _standardsSearchDataTable.Columns.Add(newCol); } LoadStandardsFilterDataTable(); }
/// <summary> /// Gets list of courses taken by a student. /// </summary> /// <param name="id">A unique student id.</param> /// <param name="isStudent">Boolean flag for student. True if user is a student else false.</param> /// <returns>A list of courses.</returns> public static CourseList GetItem(string id, bool isStudent) { CourseList myCourseList = null; using (SqlConnection myConnection = new SqlConnection(AppSettings.ConnectionString)) { //SqlCommand cmd = new SqlCommand("Select * from Course where CourseID = 'cid01'",myConnection); string callProcedure = isStudent ? "spGetEnrolledCourseListByStudent" : "spGetEnrolledCourseListByInstructor"; SqlCommand myCommand = new SqlCommand(callProcedure, myConnection); myCommand.CommandType = CommandType.StoredProcedure; myCommand.Parameters.AddWithValue("@id", id); myConnection.Open(); using (SqlDataReader myDataReader = myCommand.ExecuteReader()) { if (myDataReader.HasRows) { myCourseList = new CourseList(); while (myDataReader.Read()) { myCourseList.Add(FillRecord(myDataReader)); } } myDataReader.Close(); } myConnection.Close(); } return(myCourseList); }
/// <summary> /// Handle department list change /// Get available from selected department /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void departmentList_SelectedIndexChanged(object sender, EventArgs e) { var departmentId = int.Parse(departmentList.SelectedValue); CourseList.DataSource = course.GetCourseByDepartmentId(departmentId); CourseList.DataBind(); }
private void InitCoursesList() { List <CourseModel> currentCourses = new List <CourseModel>(); using (var client = HttpHelpers.InitializeHttpClient()) { HttpResponseMessage response = client.GetAsync("api/course").Result; if (HttpHelpers.IsSuccessfullRequest(response, "Váratlan hiba történt, a kuzusok lekérdezése nem sikerült. Kérjük, próbálja később!")) { currentCourses = response.Content.ReadAsAsync <IEnumerable <CourseModel> >().Result.ToList(); } } int selectedCourseId = 0; if (SelectedCourse != null) { selectedCourseId = SelectedCourse.CourseID; } CourseList = currentCourses; if (selectedCourseId != 0) { SelectedCourse = CourseList.First(c => c.CourseID == selectedCourseId); } }
protected void SetupList() { if (RadioButtonList1.SelectedValue == "Staff") { StaffList stl1 = new StaffList(); stl1.LoadList(DateTime.Now, true); ListBox_staff.Items.Clear(); foreach (SimpleStaff s1 in stl1.m_stafflist) { ListItem l = new ListItem(s1.m_StaffCode, s1.m_StaffId.ToString()); ListBox_staff.Items.Add(l); } } if (RadioButtonList1.SelectedValue == "Subjects") { ListBox_staff.Items.Clear(); CourseList cl1 = new CourseList(5); foreach (Course c in cl1._courses) { ListItem l = new ListItem(c.CourseCode, c._CourseID.ToString()); ListBox_staff.Items.Add(l); } } if (RadioButtonList1.SelectedValue == "All") { StaffList stl1 = new StaffList(); stl1.LoadList(DateTime.Now, true); ListBox_staff.Items.Clear(); foreach (SimpleStaff s1 in stl1.m_stafflist) { ListItem l = new ListItem(s1.m_StaffCode, s1.m_StaffId.ToString()); ListBox_staff.Items.Add(l); l.Selected = true; } } }
protected void Page_Load(object sender, EventArgs e) { string pagename = Path.GetFileName(Request.PhysicalPath); if (Session["admin"] != null) { string action = Request.QueryString["action"]; id = int.Parse(Request.QueryString["Timetableid"]); if (!IsPostBack) { DBFunctions db = new DBFunctions(); if (action == "update") { CourseList.DataSource = db.getcourselist(); CourseList.DataValueField = "ID"; CourseList.DataTextField = "Course"; CourseList.DataBind(); // Courses_tbl course = db.getcourses(id); TimeTable_tbl ds = db.getTimeTable(id); DropDownDay.SelectedValue = ds.Day; STime.Text = ds.StartTime; ETime.Text = ds.EndTime; TeacherList.SelectedValue = ds.Teacher; } else { } } } else { Response.Redirect("Login.aspx?Redirecturl=" + pagename); } }
public void TestAddCourse() { var f = new CourseList(); f.addCourse("Test", 10, 50, 0, 0, 0, 0, 0, 0, 0, "Description"); Assert.IsTrue(GlobalItems.checkItemsInDB("course", "name", "Test")); }
public ActionResult Delete(string id = null) { CourseList cList = new CourseList(); List <CourseClass> obj = cList.GetCourseClasses(id); return(View(obj.FirstOrDefault())); }
protected void Page_Load(object sender, EventArgs e) { var gradeList = new List<string>(); var subjectList = new List<string>(); SessionObject = (SessionObject)Session["SessionObject"]; _itemBankTbl = ItemBankMasterList.GetItemBanksForUser(SessionObject.LoggedInUser, ThinkgatePermission.PermissionLevelValues.ItemBankEdit, "Search"); if (LoadRubric() == false) return; _standardCourseList = CourseMasterList.GetStandardCoursesForUser(SessionObject.LoggedInUser); _gradeList = _standardCourseList.GetGradeList(); _subjectList = _standardCourseList.FilterByGrade(_rubric.Grade).GetSubjectList(); gradeList.Add(_rubric.Grade); subjectList.Add(_rubric.Subject); _courseList = _standardCourseList.FilterByGradesAndSubjects(gradeList, subjectList); BindPageControls(); /* Preview consists of Directions section + Content */ ContentEditor_Rubric_Preview_Directions.InnerHtml = _rubric.Directions; ContentEditor_Rubric_Preview_Contents.InnerHtml = _rubric.Content; }
/// <summary> /// 命令执行 /// </summary> /// <param name="context"></param> public override void Execute(DataContext context) { byte[] cmdData = context.CmdData; if (cmdData.Length == 0) { context.Flush(RespondCode.CmdDataLack); return; } CourseQuery query = cmdData.ProtoBufDeserialize <CourseQuery>(); if (Compiled.Debug) { query.Debug("=== School.QueryCourses 请求数据 ==="); } UserCacheInfo userCache = UserBiz.ReadUserCacheInfo(context.UserId); if (userCache.UserSite > 0) { PageResult <CourseBase> pageResult = SchoolBiz.GetSchoolCoursePageList(userCache.UserSite, query.QueryIndex, query.QuerySize); CourseList result = new CourseList { RecordCount = pageResult.RecordCount, QueryIndex = pageResult.PageIndex, QuerySize = pageResult.PageSize, IndexCount = pageResult.PageCount, DataList = pageResult.Data.Select(c => c.ToCourseInfo()).ToList() }; context.Flush <CourseList>(result); return; } context.Flush(RespondCode.DataInvalid); }
/// <summary> /// Gets a list of Courses /// </summary> /// <returns>List of Courses</returns> public static CourseList GetItem() { CourseList myCourseList = null; using (SqlConnection myConnection = new SqlConnection(AppSettings.ConnectionString)) { SqlCommand myCommand = new SqlCommand("spSelectCourseList", myConnection); myCommand.CommandType = CommandType.StoredProcedure; myConnection.Open(); using (SqlDataReader myDataReader = myCommand.ExecuteReader()) { if (myDataReader.HasRows) { myCourseList = new CourseList(); while (myDataReader.Read()) { myCourseList.Add(FillRecord(myDataReader)); } } myDataReader.Close(); } myConnection.Close(); } return(myCourseList); }
public HttpRequestMessage GetCoursePageHRM(string courseId) { Course course = CourseList.Find(c => c.Id == courseId); HttpRequestMessage hrm; if (course.IsNewWebLearning) { string url = string.Format(@"http://learn.cic.tsinghua.edu.cn/f/student/coursehome/{0}", course.Id); hrm = new HttpRequestMessage(HttpMethod.Get, new Uri(url)); foreach (System.Net.Cookie cookie in web.cc.GetCookies(new Uri("http://learn.cic.tsinghua.edu.cn"))) { hrm.Headers.Cookie.Add(new Windows.Web.Http.Headers.HttpCookiePairHeaderValue(cookie.Name, cookie.Value)); } } else { string url = string.Format(@"http://learn.tsinghua.edu.cn/MultiLanguage/lesson/student/course_locate.jsp?course_id={0}", course.Id); hrm = new HttpRequestMessage(HttpMethod.Get, new Uri(url)); foreach (System.Net.Cookie cookie in web.cc.GetCookies(new Uri("http://learn.tsinghua.edu.cn"))) { hrm.Headers.Cookie.Add(new Windows.Web.Http.Headers.HttpCookiePairHeaderValue(cookie.Name, cookie.Value)); } } return(hrm); }
public ActionResult DeleteConfirmed(int id) { CourseList courseList = db.CourseLists.Find(id); db.CourseLists.Remove(courseList); db.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Delete(CourseClass c) { CourseList cList = new CourseList(); cList.DeleteCourse(c); return(RedirectToAction("Index")); }
public ActionResult Edit(CourseClass c) { CourseList cList = new CourseList(); cList.UpdateCourse(c); return(RedirectToAction("Index")); }
public AddTaughtCourse() { //instantiating the objects to be used in the InitializeComponent(); taughtCourses = new TaughtCourseList(); courses = new CourseList(); }
public void InitDetection() { signDetector = new SignDetector(); courseAdvisor = new CourseAdvisor(droneControl.BottomCameraPictureSize, droneControl.BottomCameraFieldOfViewDegrees); course = new CourseList(); InitDetectionSliders(); }
public void TestAddCourse() { var course = new Course("GetIT"); var courseList = new CourseList(); var result = courseList.AddCourse(course); Assert.AreEqual(true, result); }
protected override void LoadInitalData() { db.Courses.Where(c => c.External == false && c.Obselete == false).OrderBy(c => c.CourseName).Load(); CourseList = db.Courses.Local.Where(c => c.External == false && c.Obselete == false).OrderBy(c => c.CourseName).ToList(); SelectedCourse = CourseList.First(); ResetSearch(null); }
public void RemoveCourses(Courses course) { var remove = CourseList.Remove(CourseList.Where(rmv => rmv.Name == course.Name).Single()); if (remove) { CourseList.CollectionChanged += CourseList_CollectionChanged; } }
private void _FetchSpecCourse() { String query = "SELECT * FROM spec_course_info;"; foreach (var v in PerformDatabaseCourseAccess(query)) { CourseList.Add(v); } }
private void CourseList_SelectedIndexChanged(object sender, EventArgs e) { Course course = new Course(); string name = CourseList.GetItemText(CourseList.SelectedItem); double list = course.getCourse(name); PriceTbx.Text = list.ToString(); }
public AverageGrade() { //instantiating the variables InitializeComponent(); sections = new SectionList(); students = new StudentList(); courses = new CourseList(); secStuds = new SectionStudentList(); }
private void AddBtn_Click(object sender, EventArgs e) { string groupName = NameTbx.Text; string courseName = CourseList.GetItemText(CourseList.SelectedItem); Group newGroup = new Group(); string text = newGroup.addNewGroup(courseName, groupName); MessageBox.Show(text); }
public async Task And_Not_Cached_Then_Gets_Courses_From_Api( CourseList coursesFromApi, [Frozen] Mock <ICacheStorageService> mockCacheService, [Frozen] Mock <IApiClient> mockApiClient, CourseService service) { mockCacheService .Setup(storageService => storageService.RetrieveFromCache <CourseList>(nameof(CourseList))) .ReturnsAsync((CourseList) default);
public async Task <UpdateResult> RefWorkList(string courseId) { Course course = CourseList.Find(c => c.Id == courseId); List <Work> newList = course.IsNewWebLearning ? await web.GetWorkListNew(course.Id):await web.GetWorkListOld(course.Id); Merge.WorkList(course.WorkList, newList); return(UpdateResult.Success); }
protected void Page_Load(object sender, EventArgs e) { session = (SessionObject)Session["SessionObject"]; _curriculumCourseList = Thinkgate.Base.Classes.CourseMasterList.GetCurrCoursesForUser(session.LoggedInUser); _teacherID = DataIntegrity.ConvertToInt(session.LoggedInUser.Page); hdnNodeId.Value = QueryHelper.GetString("id", "-1"); hdnWorksheetId.Value = QueryHelper.GetString("WorksheetID", ""); hdnType.Value = Convert.ToString(QueryHelper.GetString("type", "")); if (!IsPostBack) { ///Only for Teacher set default value of grade ,subject, course. //subject = session.AssessmentBuildParms.ContainsKey("Subject") ? session.AssessmentBuildParms["Subject"] : string.Empty; //course = session.AssessmentBuildParms.ContainsKey("Course") ? DataIntegrity.ConvertToInt(session.AssessmentBuildParms["Course"]) : 0; //grade = session.AssessmentBuildParms.ContainsKey("Grade") ? session.AssessmentBuildParms["Grade"] : string.Empty; //BindClassTypes(); competencyRubricsPageList = CompetencyWorkSheet.CompetencyRubricsPage(); if (Request.QueryString["type"] != null) { if (type == "Edit") { btnContinue.Visible = false; btnSave.Visible = true; btnCancel.OnClientClick = "CloseDialog('" + type.ToLower() + "');"; cmbRubric.Enabled = false; gradeDropdown.Enabled = false; subjectDropdown.Enabled = false; courseDropdown.Enabled = false; } else if (type.ToLower() == "copy" || type.ToLower() == "'update'") { btnCancel.OnClientClick = "CloseDialog('" + type.ToLower().Replace("'", "") + "');"; btnContinue.Text = " Save "; btnSave.Visible = false; } BindCompetencyWorkSheet(worksheetId); } else { txtName.Text = QueryHelper.GetString("name", ""); txtDescription.Text = QueryHelper.GetString("desc", ""); subject = session.clickedClass.Subject.DisplayText != "" ? session.clickedClass.Subject.DisplayText : string.Empty; courseName = session.clickedClass.Course.CourseName != "" ? session.clickedClass.Course.CourseName : string.Empty; grade = session.clickedClass.Grade.DisplayText != "" ? session.clickedClass.Grade.DisplayText : string.Empty; LoadGradeButtonFilter(); LoadSubjectsButtonFilter(); LoadCoursesButtonFilter(); } BindRubricsItems(grade, subject, Convert.ToString(course)); } }
protected void Page_Load(object sender, EventArgs e) { SessionObject = (SessionObject)Session["SessionObject"]; _itemBankTbl = ItemBankMasterList.GetItemBanksForUser(SessionObject.LoggedInUser, ThinkgatePermission.PermissionLevelValues.ItemBankEdit, "Search"); LoadItemImage(); _standardCourseList = CourseMasterList.GetStandardCoursesForUser(SessionObject.LoggedInUser); _gradeList = _standardCourseList.GetGradeList(); _subjectList = _standardCourseList.FilterByGrade(_selectedAddendum.Addendum_Grade).GetSubjectList(); var gradeList = new List<string>(); var subjectList = new List<string>(); gradeList.Add(_selectedAddendum.Addendum_Grade); subjectList.Add(_selectedAddendum.Addendum_Subject); _courseList = _standardCourseList.FilterByGradesAndSubjects(gradeList, subjectList); BindPageControls(); }
private void bindCourseList(DataList dlCourseList) { clist = (Session["role"].ToString() == "Student") ? CourseController.GetItem(id, true) : CourseController.GetItem(id, false); DataTable dt = new DataTable(); DataColumn dc = new DataColumn(); dc.DataType = Type.GetType("System.String"); dc.ColumnName = "CourseName"; dt.Columns.Add(dc); DataColumn dc2 = new DataColumn(); dc2.DataType = Type.GetType("System.String"); dc2.ColumnName = "InstructorName"; dt.Columns.Add(dc2); DataColumn dc3 = new DataColumn(); dc3.DataType = Type.GetType("System.String"); dc3.ColumnName = "ViewInfo"; dt.Columns.Add(dc3); DataColumn dc4 = new DataColumn(); dc4.DataType = Type.GetType("System.String"); dc4.ColumnName = "CourseID"; dt.Columns.Add(dc4); DataRow dr; foreach (Course c1 in clist) { dr = dt.NewRow(); dr["CourseName"] = c1.CName; dr["InstructorName"] = c1.Instructor.FullName; dr["ViewInfo"] = "View Course Info"; dr["CourseID"] = c1.CourseId; dt.Rows.Add(dr); } dlCourseList.DataSource = dt; dlCourseList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { LoadItemImage(); if (hdnFlagDeleteConfirmation.Value != "") { RadToolBarItem itemToDisable = mainToolBar.FindItemByValue("DeleteItemImage"); itemToDisable.Enabled = false; } _standardCourseList = CourseMasterList.GetStandardCoursesForUser(SessionObject.LoggedInUser); _gradeList = _standardCourseList.GetGradeList(); _subjectList = _standardCourseList.FilterByGrade(SelectedImage.Grade).GetSubjectList(); var gradeList = new List<string>(); var subjectList = new List<string>(); gradeList.Add(SelectedImage.Grade); subjectList.Add(SelectedImage.Subject); _courseList = _standardCourseList.FilterByGradesAndSubjects(gradeList, subjectList); BindPageControls(); ScriptManager.RegisterStartupScript(this, typeof(string), "appClient", "var gr_preset = '" + SelectedImage.Grade + "';var sb_preset = '" + SelectedImage.Subject + "';var cr_preset = '" + SelectedImage.Course + "';", true); }
/// <summary> /// Gets a list of Courses /// </summary> /// <returns>List of Courses</returns> public static CourseList GetItem() { CourseList myCourseList = null; using (SqlConnection myConnection = new SqlConnection(AppSettings.ConnectionString)) { SqlCommand myCommand = new SqlCommand("spSelectCourseList", myConnection); myCommand.CommandType = CommandType.StoredProcedure; myConnection.Open(); using (SqlDataReader myDataReader = myCommand.ExecuteReader()) { if (myDataReader.HasRows) { myCourseList = new CourseList(); while (myDataReader.Read()) { myCourseList.Add(FillRecord(myDataReader)); } } myDataReader.Close(); } myConnection.Close(); } return myCourseList; }
protected new void Page_Init(object sender, EventArgs e) { base.Page_Init(sender, e); if (Tile == null || Tile.TileParms == null) return; _classID = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("selectID")); _term = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("term")); _planID = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("planID")); //_type = Tile.TileParms.GetParm("type").ToString(); //COMMENT: RE this was breaking code, not sure what/if is required put a condition to protect from breaking if (Tile.TileParms.GetParm("type") != null) _type = Tile.TileParms.GetParm("type").ToString(); if (Tile.TileParms.GetParm("level") != null) _level = (Base.Enums.EntityTypes)Tile.TileParms.GetParm("level"); if (Tile.TileParms.GetParm("levelID") != null) _levelID = (Int32)Tile.TileParms.GetParm("levelID"); if (Tile.TileParms.GetParm("showCalendarIcon") != null) _calendarIconVisible = DataIntegrity.ConvertToBool(Tile.TileParms.GetParm("showCalendarIcon")); _UseResourcesTileFilterToDisplay = (Tile.TileParms.GetParm("UseResourcesTileFilterToDisplay") ?? "").ToString().ToLower(); _currCourseList = CourseMasterList.GetCurrCoursesForUser(SessionObject.LoggedInUser); _fullAccess = UserHasPermission(Permission.Resources_Access_All); }
protected void Page_Load(object sender, EventArgs e) { lblTeacherMessage.Text = string.Empty; _classCourseList = CourseMasterList.GetClassCoursesForUser(SessionObject.LoggedInUser); _gradeList = _classCourseList.GetGradeList(); LoadClass(); /* Determine if user has permissions to access each section of edit page */ _permissionIdentification = UserHasPermission(Base.Enums.Permission.Section_Identification_EditClass); _permissionTeacher = UserHasPermission(Base.Enums.Permission.Section_Teacher_EditClass); _permissionRoster = UserHasPermission(Base.Enums.Permission.Section_Roster_EditClass); _permissionDeleteClass = UserHasPermission(Base.Enums.Permission.Delete_Class); bool reloadTeacherGrid = false; if (!string.IsNullOrEmpty(addTeacherList.Value)) { _selectedClass.LoadTeachers(); List<string> teacherUserNames = addTeacherList.Value.Split(',').ToList(); foreach (Base.Classes.Teacher teacher in _selectedClass.Teachers) { if (teacherUserNames.Contains(teacher.EmployeeID)) { teacherUserNames.Remove(teacher.EmployeeID); } } Thinkgate.Base.Classes.Class.AddTeachersToClass(teacherUserNames, _selectedClass.ID); addTeacherList.Value = string.Empty; reloadTeacherGrid = true; LoadClass(); } if (!string.IsNullOrEmpty(isSaveClass.Value)) { //SaveClass(); isSaveClass.Value = string.Empty; } if(!UserHasPermission(Base.Enums.Permission.Edit_Class)) { return; } /* Determine if user has permissions to access each section of edit page */ _permissionIdentification = UserHasPermission(Base.Enums.Permission.Section_Identification_EditClass); _permissionTeacher = UserHasPermission(Base.Enums.Permission.Section_Teacher_EditClass); _permissionRoster = UserHasPermission(Base.Enums.Permission.Section_Roster_EditClass); _permissionDeleteClass = UserHasPermission(Base.Enums.Permission.Delete_Class); //Determine if user should have ability to delete class or save changes to the class. saveButton.Enabled = _permissionIdentification || _permissionTeacher || _permissionRoster; deleteButton.Enabled = _permissionDeleteClass; deleteButton.Visible = _permissionDeleteClass; if (_selectedClass == null) { SessionObject.RedirectMessage = "No entity ID provided in URL."; Response.Redirect("~/PortalSelection.aspx", true); } _selectedClass.LoadTeachers(); _selectedClass.LoadStudents(); rosterGrid.DataSource = _selectedClass.Students; rosterGrid.DataBind(); // Disable Add Student button if user does not have permission to edit. if (!_permissionRoster) addStudentButton.Enabled = false; studentCountSpan.InnerHtml = _selectedClass.Students.Count.ToString() + " students"; if (!IsPostBack || reloadTeacherGrid) { teachersGrid.DataSource = _selectedClass.Teachers; teachersGrid.DataBind(); } // Disable Add Student button if user does not have permission to edit. if (!_permissionTeacher) { btnTeacherAdd.Enabled = false; btnTeacherRemove.Enabled = false; teachersGrid.MasterTableView.GetColumn("TeacherGridRemove").Visible = false; } LoadIdentificationDropdowns(); //PageTitle = _selectedClass.PrimaryTeacher + ": " + _selectedClass.Grade.GetFriendlyName() + " Grade " + _selectedClass.Subject.DisplayText + " - Period " + _selectedClass.Period; Page.Title = "Edit Class (" + _selectedClass.PrimaryTeacher + ": " + _selectedClass.Grade.GetFriendlyName() + " Grade " + _selectedClass.Subject.DisplayText + " - Period " + _selectedClass.Period + ")"; deleteButton.Attributes["classID"] = (_permissionDeleteClass) ? _selectedClass.ID.ToString() : "0"; saveButton.Attributes["classID"] = _selectedClass.ID.ToString(); }
protected void Page_Init(object sender, EventArgs e) { SessionObject = (Thinkgate.Classes.SessionObject)Page.Session["SessionObject"]; _curriculumCourseList = Thinkgate.Base.Classes.CourseMasterList.GetCurrCoursesForUser(SessionObject.LoggedInUser); }
private void BindDataToGrid() { var searchParms = (Criteria)Session["Criteria_" + HiddenGuid]; List<string> clusters = searchParms.CriterionList.FindAll(r => !r.IsHeader && r.Key.Contains("Cluster") && r.Object != null).Select(criterion => criterion.Object.ToString()).ToList(); List<string> schoolTypes = searchParms.CriterionList.FindAll(r => !r.IsHeader && r.Key.Contains("SchoolType") && r.Object != null).Select(criterion => criterion.Object.ToString()).ToList(); List<Int32> schoolIDs = searchParms.CriterionList.FindAll(r => !r.IsHeader && r.Header == "School" && r.Object != null) .Select(criterion => DataIntegrity.ConvertToInt(criterion.ReportStringVal)).ToList(); // List<Int32> schoolIDs = searchParms.CriterionList.FindAll(r => !r.IsHeader && r.Key == "School" && r.Object != null).Select(criterion => DataIntegrity.ConvertToInt(criterion.DataValueField)).ToList(); if (schoolIDs.Count == 0) { if (!userCrossSchools && SessionObject.LoggedInUser.Schools != null && SessionObject.LoggedInUser.Schools.Count > 0) { foreach (var s in SessionObject.LoggedInUser.Schools) { schoolIDs.Add(s.Id); } } } List<string> grades = searchParms.CriterionList.FindAll(r => r.Key.Contains("Grade") && r.Object != null).Select(criterion => criterion.Object.ToString()).ToList(); List<string> subjects = searchParms.CriterionList.FindAll(r => r.Key.Contains("Subject") && r.Object != null).Select(criterion => criterion.Object.ToString()).ToList(); #region Get: CourseList var classCourseIDs = new CourseList(); List<string> selectedCourses = searchParms.CriterionList.FindAll(r => r.Key.Contains("Course") && r.Object != null).Select(criterion => criterion.Object.ToString()).ToList(); classCourseIDs = Thinkgate.Base.Classes.CourseMasterList.GetClassCoursesForUser(SessionObject.LoggedInUser).FilterByGradesSubjectsStandardSetsAndCourse(grades, subjects, null, selectedCourses); #endregion var teacher = searchParms.CriterionList.Find(r => r.Key == "AssessmentAssignmentTeacher").Object != null ? searchParms.CriterionList.Find(r => r.Key == "AssessmentAssignmentTeacher").Object.ToString() : string.Empty; #region Get SemesterList criterion List<string> semesterList = new List<string>(); foreach (var criterion in searchParms.CriterionList.FindAll(r => r.IsHeader && r.Key.Contains("Semester") && r.Object != null)) { semesterList.Add(criterion.Object.ToString()); } #endregion #region Get Section criterion var section = searchParms.CriterionList.Find(r => r.Key == "Section").ReportStringVal ?? string.Empty; #endregion #region Get Block criterion var block = searchParms.CriterionList.Find(r => r.Key == "Block").ReportStringVal ?? string.Empty; #endregion #region Get Period criterion List<string> periodList = new List<string>(); foreach (var criterion in searchParms.CriterionList.FindAll(r => !r.IsHeader && r.Key.Contains("Period") && r.Object != null)) { periodList.Add(criterion.Object.ToString()); } #endregion GridDataTable = Thinkgate.Base.Classes.Class.SearchClasses(classCourseIDs, clusters, schoolIDs, section, teacher, semesterList, periodList, block, schoolTypes, userCrossSchools); DataTableCount = GridDataTable.Rows.Count.ToString(); radGridResults.DataSource = GridDataTable; radGridResults.DataBind(); initialDisplayText.Visible = false; resultsFoundDiv.InnerText = "Results found: " + DataTableCount.ToString(); }
public static string StudentForClass(string Grade, string Subject, string currCourseName) { Thinkgate.Classes.SessionObject SessionObject = (Thinkgate.Classes.SessionObject)System.Web.HttpContext.Current.Session["SessionObject"]; CourseList curriculumCourseList = new CourseList(); curriculumCourseList = Thinkgate.Base.Classes.CourseMasterList.GetCurrCoursesForUser(SessionObject.LoggedInUser); var coursesByGradeAndSubject = curriculumCourseList.FilterByGradeAndSubject(Grade, Subject); coursesByGradeAndSubject.Sort((x, y) => string.Compare(x.CourseName, y.CourseName)); int currCourseID = 0; foreach (var c in coursesByGradeAndSubject) { if (c.CourseName == currCourseName) { currCourseID = c.ID; } } string groupName = "groupName"; Guid? myGroupName = groupName == "groupName" ? Guid.Empty : new Guid(groupName); return CompetencyWorkSheet.GetCompetencyWorksheetStudendCount(currCourseID, myGroupName, SessionObject.LoggedInUser.UserId).ToJSON(false); }
protected new void Page_Init(object sender, EventArgs e) { base.Page_Init(sender, e); /********************************************************************************************** * Only update for this control firing (Telerik Ajax postback for all user controls) * * Looks for postback control id's containing "MTSS Interventions" (quick solution) * **********************************************************************************************/ if (IsPostBack) { String postBackControlID = GetControlThatCausedPostBack(Parent.Page); if (!String.IsNullOrEmpty(postBackControlID) && !postBackControlID.StartsWith("folder") && !postBackControlID.StartsWith("tileContainer") && !postBackControlID.Contains("MTSSInterventions")) { return; //Return to avoid pulling data again when other user controls refresh via ajax } } if (Tile == null || Tile.TileParms == null) return; //COMMENT: RE this was breaking code, not sure what/if is required put a condition to protect from breaking if (Tile.TileParms.GetParm("type") != null) Tile.TileParms.GetParm("type").ToString(); if (Tile.TileParms.GetParm("level") != null) _level = (EntityTypes)Tile.TileParms.GetParm("level"); if (Tile.TileParms.GetParm("levelID") != null) _levelID = (Int32)Tile.TileParms.GetParm("levelID"); _isFormColumnEnabled = (bool)Tile.TileParms.GetParm("isFormColumnEnabled"); btnAdd.Attributes["title"] = string.Format("Add New {0}", Tile.Title); _CurrCourseList = CourseMasterList.GetCurrCoursesForUser(SessionObject.LoggedInUser); }
private void BindDataToGridBasic() { var searchParms = (Criteria)Session["Criteria_" + HiddenGuid]; List<string> testTypes = new List<string>(); foreach (var criterion in searchParms.CriterionList.FindAll(r => !r.IsHeader && r.Key.Contains("Type") && r.Object != null && !string.IsNullOrEmpty(r.ReportStringVal))) { testTypes.Add(criterion.Object.ToString()); } List<string> testTerms = new List<string>(); foreach (var criterion in searchParms.CriterionList.FindAll(r => !r.IsHeader && r.Key.Contains("Terms") && r.Object != null && !string.IsNullOrEmpty(r.ReportStringVal))) { testTerms.Add(criterion.Object.ToString()); } var year = searchParms.CriterionList.Find(r => r.Key == "Year" && !string.IsNullOrEmpty(r.ReportStringVal)) != null ? searchParms.CriterionList.Find(r => r.Key == "Year" && !string.IsNullOrEmpty(r.ReportStringVal)).Object.ToString() : string.Empty; List<string> grades = searchParms.CriterionList.FindAll(r => r.Key.Contains("Grade") && r.Object != null && !string.IsNullOrEmpty(r.ReportStringVal)).Select(criterion => criterion.Object.ToString()).ToList(); List<string> subjects = searchParms.CriterionList.FindAll(r => r.Key.Contains("Subject") && r.Object != null && !string.IsNullOrEmpty(r.ReportStringVal)).Select(criterion => criterion.Object.ToString()).ToList(); #region Get: CourseList var currCourseIDs = new CourseList(); var selectedCurriculumCourse = searchParms.CriterionList.Find(r => r.Key == "Curriculum" && r.Empty == false && !string.IsNullOrEmpty(r.ReportStringVal)); if (selectedCurriculumCourse != null) { currCourseIDs = new CourseList() { Thinkgate.Base.Classes.CourseMasterList.GetCurrCourseById(Standpoint.Core.Utilities.DataIntegrity.ConvertToInt(selectedCurriculumCourse.ReportStringVal)) }; } else { currCourseIDs = (grades.Count > 0 || subjects.Count > 0) ? Thinkgate.Base.Classes.CourseMasterList.GetCurrCoursesForUser( SessionObject.LoggedInUser). FilterByGradesAndSubjects(grades.Count > 0 ? grades : null, subjects.Count > 0 ? subjects : null) : Thinkgate.Base.Classes.CourseMasterList.GetCurrCoursesForUser( SessionObject.LoggedInUser); } #endregion var status = searchParms.CriterionList.Find(r => r.Header == "Status").ReportStringVal ?? string.Empty; var dateCreatedStart = searchParms.CriterionList.Find(r => r.Key == "CreatedDateStart").ReportStringVal ?? string.Empty; var dateCreatedEnd = searchParms.CriterionList.Find(r => r.Key == "CreatedDateEnd").ReportStringVal ?? string.Empty; var textSearch = searchParms.CriterionList.Find(r => r.Key == "TextSearch" && !string.IsNullOrEmpty(r.ReportStringVal)) != null ? searchParms.CriterionList.Find(r => r.Key == "TextSearch").Object.ToString() : string.Empty; bool textSearchExists = new bool(); string searchOption = string.Empty; string searchText = string.Empty; if (textSearch.ToString().Contains(":")) { var tempArray = textSearch.ToString().Split(':'); if (tempArray.Length == 2) { textSearchExists = true; searchText = tempArray[1]; switch (tempArray[0]) { case "Any Words": searchOption = "any"; break; case "All Words": searchOption = "all"; break; case "Exact Phrase": searchOption = "exact"; break; case "Keywords": searchOption = "key"; break; case "Author": searchOption = "author"; break; } } } bool hasSecurePermission = SessionObject.LoggedInUser.HasPermission(Permission.Access_SecureTesting); GridDataTable = Thinkgate.Base.Classes.Assessment.SearchAssessments(currCourseIDs, SessionObject.LoggedInUser.HasPermission(Thinkgate.Base.Enums.Permission.User_Cross_Schools) ? "Yes" : "No", //CourseIDs Category, //Category testTypes.Count > 0 ? testTypes : new List<string>(), testTerms, //terms status, //status textSearchExists ? searchText : string.Empty, //textWords textSearchExists ? searchOption : string.Empty, //textWordsOpt string.IsNullOrEmpty(year) ? DistrictParms.LoadDistrictParms().Year : year, //yearList dateCreatedStart, //createdDateBegin dateCreatedEnd, //createdDateEnd null, //option SessionObject.LoggedInUser.Roles.Select(r => r.RoleName.ToString()).ToList(), hasSecurePermission); //userType if (GridDataTable.Rows.Count > 0) { GridDataTable = Standpoint.Core.Classes.Encryption.EncryptDataTableColumn(GridDataTable, "TestID", "EncryptedID"); ListOfTests = new List<int>(); foreach (DataRow row in GridDataTable.Rows) { ListOfTests.Add(DataIntegrity.ConvertToInt(row["TestID"])); } } dtPrintDateAllTest_district = Thinkgate.Base.Classes.Assessment.GetPrintSecurity_Secutity_Status_AllTest("Assessment", "District", ListOfTests); dtPrintDateAllTest_school = Thinkgate.Base.Classes.Assessment.GetPrintSecurity_Secutity_Status_AllTest("school", _schoolId.ToString(), ListOfTests); DataTableCount = GridDataTable.Rows.Count.ToString(); ProofedTestCount = (from DataRow row in GridDataTable.Rows where row["STATUS"].ToString() == "Proofed" select row).Count().ToString(); radGridResults.DataSource = GridDataTable; radGridResults.DataBind(); initialDisplayText.Visible = false; }
/// <summary> /// Get the initial values from query string /// Loads the test question or bank question /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { SessionObject = (SessionObject)Session["SessionObject"]; _itemBankTbl = ItemBankMasterList.GetItemBanksForUser(SessionObject.LoggedInUser, ThinkgatePermission.PermissionLevelValues.ItemBankEdit, "Search"); _imagesUrl = ConfigHelper.GetImagesUrl(); lbl_OTCUrl.Value = AppSettings.OTCUrl + DistrictParms.ClientID.ToString(CultureInfo.CurrentCulture); UpdateItem(); LoadItem(); _standardCourseList = CourseMasterList.GetStandardCoursesForUser(SessionObject.LoggedInUser); _gradeList = _standardCourseList.GetGradeList(); _subjectList = _standardCourseList.FilterByGrade(UseTq ? _itemTestQuestion.Grade : _itemBankQuestion.Grade).GetSubjectList(); var gradeList = new List<string>(); var subjectList = new List<string>(); gradeList.Add(UseTq ? _itemTestQuestion.Grade : _itemBankQuestion.Grade); subjectList.Add(UseTq ? _itemTestQuestion.Subject : _itemBankQuestion.Subject); BindPageControls(); SetItemPageValues(); ScriptManager.RegisterStartupScript(this, typeof(string), "appClient", "var appClient = '" + AppClient() + "';", true); ScriptManager.RegisterStartupScript(this, typeof (string), "debug_message", "function debug_message(message) {}", true); rtbBtnLRMI.Visible = DistrictParms.LRMITagging == "true"; }
/// <summary> /// Gets list of courses taken by a student. /// </summary> /// <param name="id">A unique student id.</param> /// <param name="isStudent">Boolean flag for student. True if user is a student else false.</param> /// <returns>A list of courses.</returns> public static CourseList GetItem(string id, bool isStudent) { CourseList myCourseList = null; using (SqlConnection myConnection = new SqlConnection(AppSettings.ConnectionString)) { //SqlCommand cmd = new SqlCommand("Select * from Course where CourseID = 'cid01'",myConnection); string callProcedure = isStudent ? "spGetEnrolledCourseListByStudent" : "spGetEnrolledCourseListByInstructor"; SqlCommand myCommand = new SqlCommand(callProcedure, myConnection); myCommand.CommandType = CommandType.StoredProcedure; myCommand.Parameters.AddWithValue("@id", id); myConnection.Open(); using (SqlDataReader myDataReader = myCommand.ExecuteReader()) { if (myDataReader.HasRows) { myCourseList = new CourseList(); while (myDataReader.Read()) { myCourseList.Add(FillRecord(myDataReader)); } } myDataReader.Close(); } myConnection.Close(); } return myCourseList; }
protected void Page_Load(object sender, EventArgs e) { if (Tile == null) return; // Simulate IsPostBack. String postBackControlID = GetControlThatCausedPostBack(Parent.Page); _isPostBack = !String.IsNullOrEmpty(postBackControlID) && !postBackControlID.StartsWith("folder") && !postBackControlID.StartsWith("tileContainer"); // Create the initial viewstate values. if (ViewState[_currentViewIdxKey] == null) { ViewState.Add(_currentViewIdxKey, 0); ViewState.Add(_gradeFilterKey, "All"); ViewState.Add(_subjectFilterKey, "All"); ViewState.Add(_termFilterKey, "All"); ViewState.Add(_testTypeFilterKey, "All"); } _userID = SessionObject.LoggedInUser.Page; // Set the current filter visibility. SetFilterVisibility(); SetGridHeaderText(); // Set the tab visibility. stateRadTab.Visible = UserHasPermission(Base.Enums.Permission.Tab_State_AssessmentResults); districtRadTab.Visible = UserHasPermission(Base.Enums.Permission.Tab_District_AssessmentResults); classroomRadTab.Visible = UserHasPermission(Base.Enums.Permission.Tab_Classsroom_AssessmentResults); switch (AssessmentResults_RadTabStrip.SelectedTab.Text) { case "State": IsStudentResponseVisible.Value = UserHasPermission(Permission.Reports_StudentResponses_State) ? "true" : "false"; break; case "District": IsStudentResponseVisible.Value = UserHasPermission(Permission.Reports_StudentResponses_District) ? "true" : "false"; break; case "Classroom": IsStudentResponseVisible.Value = UserHasPermission(Permission.Reports_StudentResponses_Classroom) ? "true" : "false"; break; } if (!_isPostBack) { var testSubjectDT = Subject.GetSubjectsByTests(); _currCourseList = CourseMasterList.GetCurrCoursesForUser(SessionObject.LoggedInUser); _currCourseList.RemoveAll(course => { return testSubjectDT.Select("Subject = '" + course.Subject.DisplayText + "'").Length == 0; }); BuildGrades(); BuildSubjects(); BuildTerms(); BuildTestTypes(); } BuildAssessments(); }