/// <summary> /// Initializes a new instance of the AverageSpecialtyReport class. /// </summary> /// <param name="factory"></param> public AverageSpecialtyReport(DaoFactory factory) { examDao = factory.GetExamDao(); resultDao = factory.GetResultDao(); groupDao = factory.GetGroupDao(); specialtyDao = factory.GetSpecialtyDao(); }
/// <summary> /// 生成所有索引 /// </summary> /// <param name="itemCallback"></param> public void MakeLuceneIndex(Action <Document> callback) { #region 大学专业 SpecialtyDao dao = new SpecialtyDao(); List <Specialty> list = dao.GetSpecialtyList(); PanGuAnalyzer analyzer = new PanGuAnalyzer(true); string textIndexDir = LuceneManager.GetLuceneTextIndexDirectoryPath(LuceneTextIndexType.Specialty, null); List <Document> documentList = new List <Document>(); foreach (Specialty item in list) { Document indexDoc = new Document(); #region 根据需要添加要被索引的数据列 indexDoc.Add(new NumericField("SpecialtyId", Field.Store.YES, true).SetIntValue(item.SpecialtyId)); indexDoc.Add(new Field("Name", item.Name.ToLower(), Field.Store.YES, Field.Index.ANALYZED)); #endregion 根据需要添加要被索引的数据列 documentList.Add(indexDoc); } LuceneManager.MakeIndex(documentList, textIndexDir, callback); #endregion }
/// <summary> /// Gets the DAO specialty. /// </summary> /// <returns></returns> public override SpecialtyDao GetSpecialtyDao() { if (specialtyDao == null) { specialtyDao = new SpecialtyDao(connString); } return(specialtyDao); }
private static void InitialiazeSpecialty() { SpecialtyDao specialtyDao = factory.GetSpecialtyDao(); foreach (string specialtyName in specialtyNames) { Specialty specialty = new Specialty(specialtyName); specialtyDao.Create(specialty); } }
private void FillDropDownsInfo() { buildings.ItemsSource = ClassRoomsDao.GetAllBuildings(); classRoomNumbers.ItemsSource = ClassRoomsDao.GetAllNumbers(); var allSpecialties = SpecialtyDao.GetAllSpecialties(); var allSubjects = ScheduleRecordDao.GetAllSubjects(); var allYears = ScheduleRecordDao.GetAllYears(); teacherSpecialtyCb.ItemsSource = allSpecialties; teacherSubjectCb.ItemsSource = allSubjects; teacherYearOfStudyingCb.ItemsSource = allYears; studentSpecialtyCb.ItemsSource = allSpecialties; studentSubjectCb.ItemsSource = allSubjects; studentYearOfStudyingCb.ItemsSource = allYears; var allWeeks = WeeksDao.GetFormattedWeeks(); mquery2Weeks.ItemsSource = allWeeks; var selectWeeks = new string[allWeeks.Length + 1]; selectWeeks[0] = "Всі тижні"; Array.Copy(allWeeks, 0, selectWeeks, 1, allWeeks.Length); teacherWeekSelect.ItemsSource = selectWeeks; teacherWeekSelect.SelectedIndex = 0; mquery1Weeks.ItemsSource = selectWeeks; mquery1Weeks.SelectedIndex = 0; teacherNameSelect.ItemsSource = TeacherDao.GetFormattedTeachers(); studentWeekSelect.ItemsSource = selectWeeks; studentWeekSelect.SelectedIndex = 0; studentSpecialtySelect.ItemsSource = allSpecialties; studentCourseSelect.ItemsSource = allYears; }