/// <summary>
        /// Считывает все страницы эксель файла с данными об оценках за семестер для учебных групп.
        /// Возвращает массив с информацией о каждой группе.
        /// </summary>
        /// <returns></returns>
        public RatingGroup[] ReadAllTable()
        {
            int countSheets = getCountSheets();

            if (countSheets < 1)
            {
                return(null);
            }
            RatingGroup[] result = new RatingGroup[countSheets];
            for (int i = 0; i < countSheets; i++)
            {
                //String.Equals(getNameSheet().Trim(), "7133", StringComparison.OrdinalIgnoreCase)
                string nameGroup = getNameSheet().Trim();
                if (!SQLiteManager.IsExistValue("StudyGroup", "NumGroup", nameGroup))
                {   // указанная группа не существует в БД, поэтому ничего считывать не будем
                    result[i] = new RatingGroup(null, false, false, nameGroup);
                }
                else
                {
                    DataTable table = ReadTable();
                    if (table == null)
                    {
                        result[i] = new RatingGroup(null, true, false, nameGroup);
                    }
                    else
                    {
                        result[i] = new RatingGroup(table, true, true, nameGroup);
                    }
                }
                NextSheet();
            }
            return(result);
        }
Exemplo n.º 2
0
 public PageGroupManager(TabPage page, RatingGroup ratingGroup, bool IsSpringTime, SuperTabControl parentControl)
 {
     this.parentControl     = parentControl;
     this.page              = page;
     this.ratingGroup       = ratingGroup;
     this.IsSpringTime      = IsSpringTime;
     this.id_specialization = ratingGroup.id_specialization;
     this.id_group          = ratingGroup.id_group;
     InitializeComponent();
     if (IsRatingNotNull)
     {
         if (IsSpringTime)
         {
             semester = Program.GetNumKurs(ratingGroup.NameGroup) * 2;
         }
         else
         {
             semester = Program.GetNumKurs(ratingGroup.NameGroup) * 2 - 1;
         }
         LoadData();
     }
 }