private void button1_Click(object sender, EventArgs e) { LessonSchool lesson = new LessonSchool(); // bool check= ValidateForm(); // if (check == true) // { string nameNew = LessonsName.Text; string nameEx = LessonsList.GetItemText(LessonsList.SelectedItem); string date = DateTbx.Text; string time = TimeTbx.Text; // var date = DateTime.ParseExact(dateS, "yyyyMMdd", null); //DateTime date = DateTime.Parse(DateTbx.Text); //DateTime time = DateTime.Parse(TimeTbx.Text); string groupName = GroupList.GetItemText(GroupList.SelectedItem); string courseName = CourseList.GetItemText(CourseList.SelectedItem); string roomName = RoomList.GetItemText(RoomList.SelectedItem); if (choose == 2) { ValidateForm(); string text = lesson.addNewLesson(nameNew, date, time, courseName, groupName, roomName); MessageBox.Show(text); } if (choose == 1) { ValidateForm(); string text = lesson.changeLesson(nameEx, date, time, courseName, groupName, roomName); MessageBox.Show(text); } //} }
private void AddBtn_Click(object sender, EventArgs e) { string clientName = ClientList.GetItemText(ClientList.SelectedItem); string groupName = GroupList.GetItemText(GroupList.SelectedItem); CustomerAccount client = new CustomerAccount(); string text = client.addStudenttoGroup(clientName, groupName); MessageBox.Show(text); }