private void AddCourseButton_Click(object sender, RoutedEventArgs e) { Course c = new Course(); //Pull data from text boxes and put in c c.Id = Convert.ToInt32(IdTextBox.Text); c.Designator = DesignatorTextBox.Text; c.Number = NumberTextBox.Text; c.Title = TitleTextBox.Text; c.Description = DescriptionTextBox.Text; c.Credits = Convert.ToInt32(CreditsTextBox.Text); dataLayer.AddCourse(c); }