Ejemplo n.º 1
0
        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);
            }


            //}
        }
Ejemplo n.º 2
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            string groupName  = NameTbx.Text;
            string courseName = CourseList.GetItemText(CourseList.SelectedItem);
            Group  newGroup   = new Group();
            string text       = newGroup.addNewGroup(courseName, groupName);

            MessageBox.Show(text);
        }
Ejemplo n.º 3
0
        private void CourseList_SelectedIndexChanged(object sender, EventArgs e)
        {
            Course course = new Course();
            string name   = CourseList.GetItemText(CourseList.SelectedItem);

            double list = course.getCourse(name);

            PriceTbx.Text = list.ToString();
        }
Ejemplo n.º 4
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            bool check = ValidateForm();

            if (check == true)
            {
                string text       = "";
                string courseName = CourseList.GetItemText(CourseList.SelectedItem);
                float  price      = float.Parse(PriceTbx.Text);
                Course course     = new Course();
                text = course.changePrice(courseName, price);
                MessageBox.Show(text);
            }
        }