public RClassSummary(int programClassId) { InitializeComponent(); var programClass = new CProgramClass().Get(programClassId); ReportParameters["SiteLocationId"].Value = programClass?.SiteLocationId; }
public RCompletedGraduatesStudents(int programClassId) { // // Required for telerik Reporting designer support // InitializeComponent(); var programClass = new CProgramClass().Get(programClassId); ReportParameters["SiteLocationId"].Value = programClass?.SiteLocationId; ReportParameters["StatusId"].Value = 1; ReportParameters["StartDate"].Value = DateTime.Today.AddMonths(-1); ReportParameters["EndDate"].Value = DateTime.Today; }
public RAttendanceSheet(int programClassId) { InitializeComponent(); var vwProgramClass = new CProgramClass().GetVwProgramClass(programClassId); htmlTextBoxClassInfo.Value = $@"Class : <b>{vwProgramClass.ClassName}</b><br> Instructor : <b>{vwProgramClass.InstructorName}</b><br> Room : <b>{vwProgramClass.ClassRoomName}</b><br> Time : <b>{"N/A"}</b>"; ReportParameters["ProgramClassId"].Value = programClassId; ReportParameters["StartDate"].Value = DateTime.Today.AddMonths(-1); ReportParameters["EndDate"].Value = DateTime.Today; }
protected void Page_Load(object sender, EventArgs e) { ProgramClassId = Convert.ToInt32(Request["programClassId"]); if (!IsPostBack) { } int?programCourseLevelId = null; int?programCourseId = null; int programId = 0; var cProgramClass = new CProgramClass(); var programClass = cProgramClass.Get(ProgramClassId); if (programClass != null) { programCourseLevelId = programClass.ProgramCourseLevelId; programCourseId = programClass.ProgramCourseId; programId = programClass.ProgramId; } var cGradeSchema = new CGradeSchema(); var gradeSchema = cGradeSchema.GetGradeSchema(CurrentSiteLocationId, programId, programCourseId, programCourseLevelId, ProgramClassId); if (gradeSchema != null) { RadTextBoxGrade.Text = gradeSchema.Name; GradeSchemaId = gradeSchema.GradeSchemaId; } // ProgramClass Grid LinqDataSourceClassStudentList.WhereParameters.Clear(); LinqDataSourceClassStudentList.WhereParameters.Add("ProgramClassId", DbType.Int32, ProgramClassId.ToString()); LinqDataSourceClassStudentList.Where = "ProgramClassId == @ProgramClassId"; }
protected void RadToolBarProgramClass_OnButtonClick(object sender, RadToolBarEventArgs e) { switch (e.Item.Text) { case "New": RadGridProgramClass.SelectedIndexes.Clear(); ResetForm(); break; case "Save": var cC = new CProgramClass(); var c = new Erp2016.Lib.ProgramClass(); c.ProgramId = Convert.ToInt32(RadComboBoxProgram.SelectedValue); if (string.IsNullOrEmpty(RadComboBoxProgramCourse.SelectedValue) == false) { c.ProgramCourseId = Convert.ToInt32(RadComboBoxProgramCourse.SelectedValue); } if (string.IsNullOrEmpty(RadComboBoxProgramCourseLevel.SelectedValue) == false) { c.ProgramCourseLevelId = Convert.ToInt32(RadComboBoxProgramCourseLevel.SelectedValue); } c.InstructorId = Convert.ToInt32(RadComboBoxInstructor.SelectedValue); c.ProgramClassRoomId = Convert.ToInt32(RadComboBoxClassRoom.SelectedValue); c.StartDate = RadDatePickerStartDate.SelectedDate.Value; c.EndDate = RadDatePickerEndDate.SelectedDate.Value; c.ClassWeek = Convert.ToInt32(RadComboBoxWeeks.SelectedValue); if (RadTimePickerStartMon.SelectedTime != null && RadTimePickerEndMon.SelectedTime != null) { c.MondayStartTime = RadTimePickerStartMon.SelectedTime; c.MondayEndTime = RadTimePickerEndMon.SelectedTime; } if (RadTimePickerStartTue.SelectedTime != null && RadTimePickerEndTue.SelectedTime != null) { c.TuesdayStartTime = RadTimePickerStartTue.SelectedTime; c.TuesdayEndTime = RadTimePickerEndTue.SelectedTime; } if (RadTimePickerStartWed.SelectedTime != null && RadTimePickerEndWed.SelectedTime != null) { c.WednesdayStartTime = RadTimePickerStartWed.SelectedTime; c.WednesdayEndTime = RadTimePickerEndWed.SelectedTime; } if (RadTimePickerStartThu.SelectedTime != null && RadTimePickerEndThu.SelectedTime != null) { c.ThursdayStartTime = RadTimePickerStartThu.SelectedTime; c.ThursdayEndTime = RadTimePickerEndThu.SelectedTime; } if (RadTimePickerStartFri.SelectedTime != null && RadTimePickerEndFri.SelectedTime != null) { c.FridayStartTime = RadTimePickerStartFri.SelectedTime; c.FridayEndTime = RadTimePickerEndFri.SelectedTime; } c.WeekDays = RadNumericTextBoxClassDays.Value; c.WeekHours = RadNumericTextBoxClassHours.Value; c.TotalHours = RadNumericTextBoxTotalHours.Value; c.SiteLocationId = CurrentSiteLocationId; c.Name = RadTextBoxProgramClass.Text; c.Description = RadTextBoxDescription.Text; c.IsActive = RadButtonActive.Checked; c.CreatedId = CurrentUserId; c.CreatedDate = DateTime.Now.Date; if (cC.Add(c) > 0) { ShowMessage("'" + c.Name + "' is added."); RadGridProgramClass.Rebind(); } else { ShowMessage("Failed to add"); } break; case "Update": if (RadGridProgramClass.SelectedValue != null) { var cP = new CProgramClass(); var p = cP.Get(Convert.ToInt32(RadGridProgramClass.SelectedValue)); p.ProgramId = Convert.ToInt32(RadComboBoxProgram.SelectedValue); if (string.IsNullOrEmpty(RadComboBoxProgramCourse.SelectedValue) == false) { p.ProgramCourseId = Convert.ToInt32(RadComboBoxProgramCourse.SelectedValue); } else { p.ProgramCourseId = null; } if (string.IsNullOrEmpty(RadComboBoxProgramCourseLevel.SelectedValue) == false) { p.ProgramCourseLevelId = Convert.ToInt32(RadComboBoxProgramCourseLevel.SelectedValue); } else { p.ProgramCourseLevelId = null; } p.InstructorId = Convert.ToInt32(RadComboBoxInstructor.SelectedValue); p.ProgramClassRoomId = Convert.ToInt32(RadComboBoxClassRoom.SelectedValue); p.StartDate = RadDatePickerStartDate.SelectedDate.Value; p.EndDate = RadDatePickerEndDate.SelectedDate.Value; p.ClassWeek = Convert.ToInt32(RadComboBoxWeeks.SelectedValue); if (RadTimePickerStartMon.SelectedTime != null && RadTimePickerEndMon.SelectedTime != null) { p.MondayStartTime = RadTimePickerStartMon.SelectedTime; p.MondayEndTime = RadTimePickerEndMon.SelectedTime; } if (RadTimePickerStartTue.SelectedTime != null && RadTimePickerEndTue.SelectedTime != null) { p.TuesdayStartTime = RadTimePickerStartTue.SelectedTime; p.TuesdayEndTime = RadTimePickerEndTue.SelectedTime; } if (RadTimePickerStartWed.SelectedTime != null && RadTimePickerEndWed.SelectedTime != null) { p.WednesdayStartTime = RadTimePickerStartWed.SelectedTime; p.WednesdayEndTime = RadTimePickerEndWed.SelectedTime; } if (RadTimePickerStartThu.SelectedTime != null && RadTimePickerEndThu.SelectedTime != null) { p.ThursdayStartTime = RadTimePickerStartThu.SelectedTime; p.ThursdayEndTime = RadTimePickerEndThu.SelectedTime; } if (RadTimePickerStartFri.SelectedTime != null && RadTimePickerEndFri.SelectedTime != null) { p.FridayStartTime = RadTimePickerStartFri.SelectedTime; p.FridayEndTime = RadTimePickerEndFri.SelectedTime; } p.WeekDays = RadNumericTextBoxClassDays.Value; p.WeekHours = RadNumericTextBoxClassHours.Value; p.TotalHours = RadNumericTextBoxTotalHours.Value; p.SiteLocationId = CurrentSiteLocationId; p.Name = RadTextBoxProgramClass.Text; p.Description = RadTextBoxDescription.Text; p.IsActive = RadButtonActive.Checked; p.UpdatedId = CurrentUserId; p.UpdatedDate = DateTime.Now.Date; if (cP.Update(p)) { ShowMessage("'" + p.Name + "' is updated."); RadGridProgramClass.Rebind(); } else { ShowMessage("Failed to update"); } } break; case "Student Information": if (RadGridProgramClass.SelectedValue != null) { RunClientScript("ShowStudentClassInfo('" + RadGridProgramClass.SelectedValue + "', '" + RadGridProgramClass.SelectedValues["ProgramCourseId"] + "');"); } break; case "Student Attendance": if (RadGridProgramClass.SelectedValue != null) { RunClientScript("ShowStudentClassAttendance('" + RadGridProgramClass.SelectedValue + "');"); } break; case "Student Grade": if (RadGridProgramClass.SelectedValue != null) { RunClientScript("ShowStudentClassGrade('" + RadGridProgramClass.SelectedValue + "');"); } break; // Schools case "Class Summary": if (RadGridProgramClass.SelectedValue != null) { RunClientScript("ShowReportPop('" + RadGridProgramClass.SelectedValue + "', '" + (int)CConstValue.Report.ClassSummary + "' );"); } break; case "Starting Students": if (RadGridProgramClass.SelectedValue != null) { RunClientScript("ShowReportPop('" + RadGridProgramClass.SelectedValue + "', '" + (int)CConstValue.Report.StartingStudents + "' );"); } break; case "Completed Graduates Students": if (RadGridProgramClass.SelectedValue != null) { RunClientScript("ShowReportPop('" + RadGridProgramClass.SelectedValue + "', '" + (int)CConstValue.Report.CompletedGraduatesStudents + "' );"); } break; case "Attendance Sheet": if (RadGridProgramClass.SelectedValue != null) { RunClientScript("ShowReportPop('" + RadGridProgramClass.SelectedValue + "', '" + (int)CConstValue.Report.AttendanceSheet + "');"); } break; } }
protected void GetProgramClass() { ResetForm(); if (RadGridProgramClass.SelectedValue != null) { var c = new CProgramClass().Get(Convert.ToInt32(RadGridProgramClass.SelectedValue)); if (c != null) { var program = new CProgram().Get(c.ProgramId); if (program != null) { if (program.ProgramGroupId != null) { var programGroup = new CProgramGroup().Get(Convert.ToInt32(program.ProgramGroupId)); if (programGroup != null) { RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString(); LoadProgramGroup(RadComboBoxFaculty.SelectedValue); } RadComboBoxProgramGroup.SelectedValue = program.ProgramGroupId.ToString(); LoadProgram(RadComboBoxProgramGroup.SelectedValue); } RadComboBoxProgram.SelectedValue = program.ProgramId.ToString(); LoadProgramCourse(RadComboBoxProgram.SelectedValue); if (c.ProgramCourseId != null) { var programCourse = new CProgramCourse().Get((int)c.ProgramCourseId); if (programCourse != null) { RadComboBoxProgramCourse.SelectedValue = programCourse.ProgramCourseId.ToString(); LoadProgramCourseLevel(RadComboBoxProgramCourse.SelectedValue); } } if (c.ProgramCourseLevelId != null) { var programCourseLevel = new CProgramCourseLevel().Get((int)c.ProgramCourseLevelId); if (programCourseLevel != null) { RadComboBoxProgramCourseLevel.SelectedValue = programCourseLevel.ProgramCourseLevelId.ToString(); } } } RadComboBoxInstructor.SelectedValue = c.InstructorId.ToString(); RadTextBoxProgramClass.Text = c.Name; RadTextBoxDescription.Text = c.Description; RadButtonActive.Checked = c.IsActive; RadDatePickerStartDate.SelectedDate = c.StartDate; RadDatePickerEndDate.SelectedDate = c.EndDate; RadComboBoxWeeks.SelectedValue = c.ClassWeek.ToString(); RadTimePickerStartMon.SelectedTime = c.MondayStartTime; RadTimePickerStartTue.SelectedTime = c.TuesdayStartTime; RadTimePickerStartWed.SelectedTime = c.WednesdayStartTime; RadTimePickerStartThu.SelectedTime = c.ThursdayStartTime; RadTimePickerStartFri.SelectedTime = c.FridayStartTime; RadTimePickerEndMon.SelectedTime = c.MondayEndTime; RadTimePickerEndTue.SelectedTime = c.TuesdayEndTime; RadTimePickerEndWed.SelectedTime = c.WednesdayEndTime; RadTimePickerEndThu.SelectedTime = c.ThursdayEndTime; RadTimePickerEndFri.SelectedTime = c.FridayEndTime; } SetClassTime(); RadToolBarProgramClass.FindItemByText("New").Enabled = true; if (RadToolBarProgramClass.FindItemByText("Save") != null) { RadToolBarProgramClass.FindItemByText("Save").Text = "Update"; } } }
protected void Page_Load(object sender, EventArgs e) { Id = Convert.ToInt32(Request["id"]); Type = Request["type"]; if (!IsPostBack) { ResetForm(); // new if (Type == "0") { // } // modify else { var gradeSchema = new CGradeSchema(); var grade = gradeSchema.Get(Id); if (grade != null) { RadTextBoxName.Text = grade.Name; if (grade.IsGlobal) { RadComboBoxIsGlobal.SelectedIndex = 0; } else { RadComboBoxIsGlobal.SelectedIndex = 1; } if (grade.ProgramId != null) { var program = new CProgram().Get(Convert.ToInt32(grade.ProgramId)); if (program != null) { var programGroup = new CProgramGroup().Get(Convert.ToInt32(program.ProgramGroupId)); if (programGroup != null) { RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString(); LoadProgramGroup(RadComboBoxFaculty.SelectedValue); } RadComboBoxProgramGroup.SelectedValue = program.ProgramGroupId.ToString(); LoadProgram(RadComboBoxProgramGroup.SelectedValue); } RadComboBoxProgram.SelectedValue = program.ProgramId.ToString(); LoadProgramCourse(RadComboBoxProgram.SelectedValue); if (grade.ProgramCourseId != null) { var programCourse = new CProgramCourse().Get(Convert.ToInt32(grade.ProgramCourseId)); if (programCourse != null) { RadComboBoxProgramCourse.SelectedValue = programCourse.ProgramCourseId.ToString(); LoadProgramCourseLevel(RadComboBoxProgramCourse.SelectedValue); if (grade.ProgramCourseLevelId != null) { var programCourseLevel = new CProgramCourseLevel().Get(Convert.ToInt32(grade.ProgramCourseLevelId)); if (programCourseLevel != null) { RadComboBoxProgramCourseLevel.SelectedValue = programCourseLevel.ProgramCourseLevelId.ToString(); LoadProgramClass(RadComboBoxProgram.SelectedValue, RadComboBoxProgramCourse.SelectedValue, RadComboBoxProgramCourseLevel.SelectedValue); if (grade.ProgramClassId != null) { var programclass = new CProgramClass().Get(Convert.ToInt32(grade.ProgramClassId)); if (programclass != null) { RadComboBoxProgramClass.SelectedValue = programclass.ProgramClassId.ToString(); } } } } } } } } } } RadComboBoxFaculty.OpenDropDownOnLoad = false; RadComboBoxProgramGroup.OpenDropDownOnLoad = false; RadComboBoxProgram.OpenDropDownOnLoad = false; RadComboBoxProgramCourse.OpenDropDownOnLoad = false; RadComboBoxProgramCourseLevel.OpenDropDownOnLoad = false; RadComboBoxProgramClass.OpenDropDownOnLoad = false; }
protected void Page_Load(object sender, EventArgs e) { var tempSplit = Request["programClassStudentIdList"].Split(','); foreach (var v in tempSplit) { _classStudentIdList.Add(Convert.ToInt32(v)); } var programClassStudent = new CProgramClassStudent().Get(_classStudentIdList[0]); CurrentProgramClassId = programClassStudent.ProgramClassId; if (!IsPostBack) { ResetForm(); var c = new CProgramClass().Get(CurrentProgramClassId); if (c != null) { var program = new CProgram().Get(c.ProgramId); if (program != null) { if (program.ProgramGroupId != null) { var programGroup = new CProgramGroup().Get(Convert.ToInt32(program.ProgramGroupId)); if (programGroup != null) { RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString(); LoadProgramGroup(RadComboBoxFaculty.SelectedValue); } RadComboBoxProgramGroup.SelectedValue = program.ProgramGroupId.ToString(); LoadProgram(RadComboBoxProgramGroup.SelectedValue); } RadComboBoxProgram.SelectedValue = program.ProgramId.ToString(); LoadProgramCourse(RadComboBoxProgram.SelectedValue); if (c.ProgramCourseId != null) { var programCourse = new CProgramCourse().Get((int)c.ProgramCourseId); if (programCourse != null) { RadComboBoxProgramCourse.SelectedValue = programCourse.ProgramCourseId.ToString(); LoadProgramCourseLevel(RadComboBoxProgramCourse.SelectedValue); } } if (c.ProgramCourseLevelId != null) { var programCourseLevel = new CProgramCourseLevel().Get((int)c.ProgramCourseLevelId); if (programCourseLevel != null) { RadComboBoxProgramCourseLevel.SelectedValue = programCourseLevel.ProgramCourseLevelId.ToString(); LoadProgramClass(RadComboBoxProgramCourse.SelectedValue, CurrentProgramClassId); } } } } } SearchProgramClassStudent(); RadComboBoxFaculty.OpenDropDownOnLoad = false; RadComboBoxProgramGroup.OpenDropDownOnLoad = false; RadComboBoxProgram.OpenDropDownOnLoad = false; RadComboBoxProgramCourse.OpenDropDownOnLoad = false; RadComboBoxProgramCourseLevel.OpenDropDownOnLoad = false; RadComboBoxProgramClass.OpenDropDownOnLoad = false; }