コード例 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Student stu = new Student()
            {
                FullName    = "Joe Ortiz",
                DateOfBirth = DateTime.Today
            };

            StudentDb.Add(stu);
            MessageBox.Show($"#{stu.StudentId} added");

            List <Student> allStus = StudentDb.GetAllStudents();

            MessageBox.Show("Total students: " + allStus.Count);

            stu.FullName = "Instructor Ortiz";
            StudentDb.Update(stu);
            MessageBox.Show("Student Updated");

            StudentDb.Delete(stu);
            allStus = StudentDb.GetAllStudents();
            MessageBox.Show("Total students: " + allStus.Count);
        }
コード例 #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Student stu = new Student()
            {
                FullName    = "Travis Eiler",
                DateOfBirth = DateTime.Today
            };

            StudentDb.Add(stu);
            //stu = StudentDb.Add(stu);
            MessageBox.Show($"Student# {stu.StudentId} Added");

            List <Student> allStus = StudentDb.GetAllStudents();

            MessageBox.Show("Total Stu's " + allStus.Count);

            stu.FullName = "Sivart ReliE";
            StudentDb.Update(stu);
            MessageBox.Show("Student Updated");

            StudentDb.Delete(stu);
            allStus = StudentDb.GetAllStudents();
            MessageBox.Show("Total Stu's " + allStus.Count);
        }