public ViewAllShedule() { InitializeComponent(); LessonSchool lessonSchool = new LessonSchool(); List <LessonSchool> list = new List <LessonSchool>(); list = lessonSchool.getSchedule(); ScheduleList.DataSource = list; }
public UserForm() { InitializeComponent(); LessonSchool lessonSchool = new LessonSchool(); List <LessonSchool> list = new List <LessonSchool>(); list = lessonSchool.getSchedule(); listBox1.DataSource = list; }
public void ViewScheduleTest() { string connStr = @"Data Source=DESKTOP-SDGK59R\SQLEXPRESS; Initial Catalog=dance_school; Integrated Security=True"; using (TransactionScope ts = new TransactionScope()) { using (SqlConnection connection = new SqlConnection(connStr)) { connection.Open(); LessonSchool lesson = new LessonSchool(); List <LessonSchool> list = lesson.getSchedule(); Assert.AreEqual(1, list.Count); } } }