Custodio Mac Paul A. Assignment 3
Custodio Mac Paul A. Assignment 3
Assignment #3:
- Create a separate C# file in the project for a class named ‘Student.cs’ for student
record:
namespace StudentRecordsApp.Models
{
public class Student
{
public int StudentID { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public string Level { get; set; }
public string Section { get; set; }
}
}
- ‘MainWindow.xaml’ Design:
- ‘MainWindow.xaml.cs’ for the functionality of the Main Window:
using StudentRecordsApp.Models;
using System.Collections.ObjectModel;
using System.Windows;
namespace StudentRecordsApp
{
public partial class MainWindow : Window
{
public ObservableCollection<Student> Students { get; set; }
public MainWindow()
{
InitializeComponent();
Students = new ObservableCollection<Student>();
StudentDataGrid.ItemsSource = Students;
}
}
}
}
namespace StudentRecordsApp
{
public partial class StudentWindow : Window
{
public Student Student { get; private set; }
public StudentWindow()
{
InitializeComponent();
}
}
}
}
OUTPUT:
- Click the row you want to modify then press the ‘Modify’ Button to make the
Add/Modify Student Window pop up again then after modifying, click ‘Save’:
- Click the row you want to delete then press the ‘Delete’ button:
- VALIDATIONS:
a.) ID should only be numbers.
b.) First Name, Middle Name, and Last Name can only accept up to 100 characters in
length.
c.) Cannot be saved if there are no level and section tagged in the student.