-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrmStudents.cs
54 lines (42 loc) · 1.4 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
53
54
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)
{
dgvStudents.DataSource = null;
dgvStudents.DataSource = StudentRepository.GetStudents();
dgvStudents.Columns["Id"].DisplayIndex = 0;
dgvStudents.Columns["FirstName"].DisplayIndex = 1;
dgvStudents.Columns["LastName"].DisplayIndex = 2;
dgvStudents.Columns["Grade"].DisplayIndex = 3;
}
private void dgvStudents_CellContentClick(object sender, DataGridViewCellEventArgs e) {
}
private void btnEvaluateStudent_Click(object sender, EventArgs e)
{
Student student = new Student();
if(dgvStudents.CurrentRow != null)
{
student = dgvStudents.CurrentRow.DataBoundItem as Student;
}
frmEvaluateStudent frmEvaluateStudent = new frmEvaluateStudent(student);
frmEvaluateStudent.ShowDialog();
}
}
}