예제 #1
0
        //Take The enetered Name by user, into variable : Name
        //write in a textfile (studentinfo) the data ein the form (student Name and student ID)
        //call videoCapturing object

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textBox1.Text))
            {
                MessageBox.Show("Enter student Name Please.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (string.IsNullOrWhiteSpace(textBox4.Text))
            {
                MessageBox.Show("Enter student Email Please.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (addedCourses.Count == 0)
            {
                MessageBox.Show("Please choose at least one course.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (addedCourses.Count > 6)
            {
                MessageBox.Show("Please choose 6 courses only.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                newStudent.setName(textBox1.Text);
                newStudent.setEmail(textBox4.Text);
                // hankteb f file hena 3ashan nedman yekoon create new student w das submit
                File.WriteAllText(@"ids.txt", newStudent.getId().ToString());

                ///---attar---->*/// "STUDENTS.TXT" file is done here !
                newStudent.insert();
                ////////////////////////////////////////////////

                //* attar */
                // create enrollement.txt file (StudentID, CrsCode)
                foreach (string courseCode in addedCourses)
                {
                    Enrollment enroll = new Enrollment();

                    foreach (Course c in listOfCourses)
                    {
                        if (c.getCrsCode() == courseCode)
                        {
                            enroll.setStudentId(newStudent.getId());
                            enroll.setCourseId(c.getId());
                            enroll.insert();
                        }
                    }
                }

                VideoCapturing form = new VideoCapturing();
                form.Tag = this;
                form.Show(this);
                Hide();
            }
        }
예제 #2
0
        //Take The enetered Name by user, into variable : Name
        //write in a textfile (studentinfo) the data ein the form (student Name and student ID)
        //call videoCapturing object
        //
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textBox1.Text))
            {
                MessageBox.Show("Enter student Name Please.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                Name = textBox1.Text;

                System.IO.File.AppendAllText(@"StudentInfo.txt", ID + " " + Name + Environment.NewLine);
                VideoCapturing form = new VideoCapturing(selectedCourse);
                form.Tag = this;
                form.Show(this);
                Hide();
            }
        }
예제 #3
0
        //Take The enetered Name by user, into variable : Name
        //write in a textfile (studentinfo) the data ein the form (student Name and student ID)
        //call videoCapturing object

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textBox1.Text))
            {
                MessageBox.Show("Enter student Name Please.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (string.IsNullOrWhiteSpace(textBox4.Text))
            {
                MessageBox.Show("Enter student Email Please.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (addedCourses.Count == 0)
            {
                MessageBox.Show("Please choose at least one course.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (addedCourses.Count > 6)
            {
                MessageBox.Show("Please choose 6 courses only.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                newStudent.setName(textBox1.Text);
                // hankteb f file hena 3ashan nedman yekoon create new student w das submit
                File.WriteAllText(@"ids.txt", newStudent.getID());

                ///---attar---->*/// "STUDENTS.TXT" file is done here !
                File.AppendAllText(@"StudentInfo.txt", newStudent.getID() + " " + newStudent.getName() + " " + newStudent.getEmail() + Environment.NewLine);
                ////////////////////////////////////////////////

                //* attar */
                // create enrollement.txt file (StudentID, CrsCode)
                foreach (string courseCode in addedCourses)
                {
                    File.AppendAllText(@"enrollement.txt", newStudent.getID() + "," + courseCode + Environment.NewLine);
                }

                VideoCapturing form = new VideoCapturing();
                form.Tag = this;
                form.Show(this);
                Hide();
            }
        }
예제 #4
0
        //Take The enetered Name by user, into variable : Name
        //write in a textfile (studentinfo) the data ein the form (student Name and student ID)
        //call videoCapturing object

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textBox1.Text))
            {
                MessageBox.Show("Enter student Name Please.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (string.IsNullOrWhiteSpace(textBox4.Text))
            {
                MessageBox.Show("Enter student Email Please.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (addedCourses.Count == 0)
            {
                MessageBox.Show("Please choose at least one course.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (addedCourses.Count > 6)
            {
                MessageBox.Show("Please choose 6 courses only.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                newStudent.setName(textBox1.Text);
                // hankteb f file hena 3ashan nedman yekoon create new student w das submit
                File.WriteAllText(@"ids.txt", newStudent.getID());

                ///---attar---->*/// "STUDENTS.TXT" file is done here !
                File.AppendAllText(@"StudentInfo.txt", newStudent.getID() + " " + newStudent.getName() + " " + newStudent.getEmail() + Environment.NewLine);
                ////////////////////////////////////////////////

                //* attar */
                // create enrollement.txt file (StudentID, CrsCode)
                foreach (string courseCode in addedCourses)
                {
                    File.AppendAllText(@"enrollement.txt", newStudent.getID() + "," + courseCode + Environment.NewLine);
                }

                VideoCapturing form = new VideoCapturing();
                form.Tag = this;
                form.Show(this);
                Hide();
            }
        }