Пример #1
0
        private void buttonSave_Click(object sender, EventArgs e)
        {
            //Save Data in to Database.

            List<Student> students = RegistrationForm.st;
            Data data = new Data();
            if (students.Count>0)
            {
                foreach (Student student in students)
                {
                    if (student != null)
                    {
                        data.InsertStudent(student);
                    }

                }
                MessageBox.Show("done");
                RegistrationForm.st = null;
                RegistrationForm.st = new List<Student>();
            }
            else
            {
                MessageBox.Show("No user Found");
            }
        }
Пример #2
0
        private void RegistrationForm_Load(object sender, EventArgs e)
        {
            //Display Student Id on textbox

            Data data = new Data();
            loadnumber = data.StudentID();
            ++loadnumber;

            if (newNumber > loadnumber)
            {
                textBoxStudentID.Text = (newNumber).ToString();
            }
            else
            {
                textBoxStudentID.Text = (loadnumber).ToString();
            }
        }