-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFrmStudents.cs
52 lines (46 loc) · 1.48 KB
/
FrmStudents.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using Evaluation_Manager.Models;
using Evaluation_Manager.Repositories;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Evaluation_Manager
{
public partial class FrmStudents : Form
{
public FrmStudents()
{
InitializeComponent();
}
private void FrmStudents_Load(object sender, EventArgs e)
{
ShowStudents();
}
private void ShowStudents()
{
var students = StudentRepository.GetStudents();
dgvStudents.DataSource = students;
dgvStudents.Columns["Id"].DisplayIndex = 0;
dgvStudents.Columns["FirstName"].DisplayIndex = 1;
dgvStudents.Columns["LastName"].DisplayIndex = 2;
dgvStudents.Columns["Grade"].DisplayIndex = 3;
}
private void btnEvaluateStudent_Click(object sender, EventArgs e) {
Student selectedStudent = dgvStudents.CurrentRow.DataBoundItem as Student;
if (selectedStudent != null) {
FrmEvaluation frmEvaluation = new FrmEvaluation(selectedStudent);
frmEvaluation.ShowDialog();
}
}
private void btnGenerateEvaluationReport_Click(object sender, EventArgs e)
{
var form = new FrmFinalReport();
form.ShowDialog();
}
}
}