Exemple #1
0
 private void PrintListOfGroupDiscipline()
 {
     try
     {
         List <Discipline> disciplines = DataService.SelectDisciplinesByTeacherIdAndGroupId(Session.GetCurrentSession().ID, ((Group)lbGroups.SelectedItem).id);
         DataSetInitializer.lbDataSetInitialize <Discipline>(ref lbDisciplines, disciplines, "id", "full_name");
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
 private void DataSetsInitializer(uint groupID, uint disciplineID)
 {
     try
     {
         List <StudentCertification> certifications = DataService.SelectStudentsCertifications(groupID, disciplineID).GroupBy(d => d.date).Select(c => c.First()).ToList();
         DataSetInitializer.lbDataSetInitialize <StudentCertification>(ref lbListOfCerts, certifications, "date", "date");
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
Exemple #3
0
        private void txtDisciplinesFilter_TextChanged(object sender, EventArgs e)
        {
            DataSetInitializer.lbDataSetInitialize <Discipline>(ref lbGroups, originDisciplinesList, "id", "full_name");
            List <Discipline> tempDisciplines = (List <Discipline>)lbDisciplines.DataSource;

            if (string.IsNullOrWhiteSpace(txtDisciplinesFilter.Text))
            {
                return;
            }

            tempDisciplines = tempDisciplines.Where(x => x.name.ToLower().StartsWith(txtDisciplinesFilter.Text.ToLower())).ToList();
            DataSetInitializer.lbDataSetInitialize <Discipline>(ref lbGroups, tempDisciplines, "id", "full_name");
        }
Exemple #4
0
 private void InitializeDataSets()
 {
     try
     {
         List <Group> teacherGroups = originGroupsList = DataService.SelectGroupsByTeacherId(Session.GetCurrentSession().ID);
         DataSetInitializer.lbDataSetInitialize <Group>(ref lbGroups, teacherGroups, "id", "name");
         List <Discipline> disciplines = originDisciplinesList = DataService.SelectDisciplinesByTeacherIdAndGroupId(Session.GetCurrentSession().ID, ((Group)lbGroups.SelectedItem).id);
         DataSetInitializer.lbDataSetInitialize <Discipline>(ref lbDisciplines, disciplines, "id", "full_name");
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
Exemple #5
0
 private void RemoveGroup()
 {
     try
     {
         if (DataService.DeleteGroupBindingsTransact(lbDisciplines.Items.Cast <Discipline>().ToList(), Session.GetCurrentSession().ID, ((Group)lbGroups.SelectedItem).id))
         {
             List <Group> tempList = lbGroups.Items.Cast <Group>().ToList();
             tempList.RemoveAt(lbGroups.SelectedIndex);
             DataSetInitializer.lbDataSetInitialize <Group>(ref lbGroups, tempList, "id", "name");
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }