-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStudent.cs
More file actions
60 lines (54 loc) · 2.2 KB
/
Student.cs
File metadata and controls
60 lines (54 loc) · 2.2 KB
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
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Input;
namespace SWProjv1
{
public class Student : User
{
public static Student selectedStudent { get; set; }
public String studentNum { get; set; }
public bool isBlacklisted { get; set; }
public String roommateID { get; set; }
public String roomID { get; set; }
public String username { get; set; }
public String password { get; set; }
public Grid grid;
User user;
public ListBoxItem listboxitem;
public Student(String studentNum, bool isBlacklisted, String roommateID, String roomID, String firstName, String lastName, String otherName, String username, String password, String DOB) : base(firstName, lastName, otherName, username, password, DOB)
{
this.studentNum = studentNum;
this.isBlacklisted = isBlacklisted;
this.roommateID = roommateID;
this.roomID = roomID;
this.username = username;
this.password = password;
grid = new Grid();
grid.RowDefinitions.Add(new RowDefinition());
grid.RowDefinitions.Add(new RowDefinition());
grid.ColumnDefinitions.Add(new ColumnDefinition());
grid.ColumnDefinitions.Add(new ColumnDefinition());
TextBox textBox = new TextBox();
textBox.Text = firstName + " " + lastName + "\n Student Number: " + studentNum;
Grid.SetRow(textBox, 0);
Grid.SetColumn(textBox, 0);
grid.Children.Add(textBox);
}
public Student() { }
private void Item_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
selectedStudent = this;
selectedStudent.grid = grid;
}
public void setListBoxItem()
{
listboxitem = new ListBoxItem();
listboxitem.Content = firstName + " " + lastName + " " + studentNum;
listboxitem.PreviewMouseDown += Item_PreviewMouseDown;
}
}
}