示例#1
0
 private void populateGridView(DataGridView dgw, string dataType)
 {
     try
     {
         if (dataType.Equals("note") && eleviDataSet != null)
         {
             noteDataSet = service.getGradesByUser(eleviDataSet.Tables[0].Rows[elevi_box.SelectedIndex]["username"].ToString());
             if (noteDataSet != null)
             {
                 dgw.DataSource = noteDataSet.Tables[0];
             }
         }
         if (dataType.Equals("absente") && eleviDataSet != null)
         {
             absenteDataSet = service.getAbsente(eleviDataSet.Tables[0].Rows[elevi_box.SelectedIndex]["username"].ToString());
             if (absenteDataSet != null)
             {
                 dgw.DataSource = absenteDataSet.Tables[0];
             }
         }
     }
     catch (Exception ex)
     {
         string err = ex.GetType().ToString();
     }
 }
示例#2
0
 //Absente
 private void populateDataGridWithAbsente()
 {
     absenteDataSet           = service.getAbsente(username);
     dataGridView1.DataSource = absenteDataSet.Tables[0];
 }