Exemple #1
0
        private void RegisterButton_Click(object sender, RoutedEventArgs e)
        {
            CustomersRegisterCheck registerCheck = new CustomersRegisterCheck(txtEmail.Text, txtName.Text, txtSurname.Text, txtIDCard.Text, txtAddress.Text);

            if (registerCheck.CheckNullOutput == false)
            {
                MessageBox.Show("โปรดกรอกข้อมูลให้ครบถ้วน");
            }
            else if (registerCheck.CheckDoubleEmail == false)
            {
                MessageBox.Show("Email นี้ถูกใช้งานไปแล้ว");
            }
            else if (registerCheck.EmailCheckCountOutput == false)
            {
                MessageBox.Show("Email ควรมีตัวอักษรไม่เกิน 50 ตัวอักษร");
            }
            else if (registerCheck.NameCheckCountOutput == false)
            {
                MessageBox.Show("ชื่อควรมีตัวอักษรไม่เกิน 30 ตัว");
            }
            else if (registerCheck.SurnameCheckCountOutput == false)
            {
                MessageBox.Show("นามสกุลควรมีตัวอักษรไม่เกิน 30 ตัว");
            }
            else if (registerCheck.IDCardCheckCountOutput == false)
            {
                MessageBox.Show("หมายเลขบัตรประชาชนประกอบด้วยหมายเลข 13 หลัก");
            }
            else if (registerCheck.AddressCheckCountOutput == false)
            {
                MessageBox.Show("ที่อยู่สามารถกรอกได้ไม่เกิน 300 ตัวอักษร");
            }
            else
            {
                CustomersRegisterSystem customersRegister = new CustomersRegisterSystem(txtEmail.Text, txtName.Text, txtSurname.Text, txtIDCard.Text, txtAddress.Text);
                MessageBox.Show("ทำการลงทะเบียนเรียบร้อย");
                this.Close();
            }
        }
        private void RegisterButton_Click(object sender, RoutedEventArgs e)
        {
            CustomersRegisterCheck registerCheck = new CustomersRegisterCheck(txtEmail.Text, txtName.Text, txtSurname.Text, txtIDCard.Text, txtAddress.Text);

            if (registerCheck.CheckNullOutput == false)
            {
                MessageBox.Show("Please fill all the form");
            }
            else if (registerCheck.CheckDoubleEmail == false)
            {
                MessageBox.Show("This Email is already used");
            }
            else if (registerCheck.EmailCheckCountOutput == false)
            {
                MessageBox.Show("Email cannot exceed 50 characters");
            }
            else if (registerCheck.NameCheckCountOutput == false)
            {
                MessageBox.Show("Name cannot exceed 30 characters");
            }
            else if (registerCheck.SurnameCheckCountOutput == false)
            {
                MessageBox.Show("Last name cannot exceed 30 characters");
            }
            else if (registerCheck.IDCardCheckCountOutput == false)
            {
                MessageBox.Show("ID number must be 13 digits");
            }
            else if (registerCheck.AddressCheckCountOutput == false)
            {
                MessageBox.Show("Address cannot exceed 300 characters");
            }
            else
            {
                CustomersRegisterSystem customersRegister = new CustomersRegisterSystem(txtEmail.Text, txtName.Text, txtSurname.Text, txtIDCard.Text, txtAddress.Text);
                MessageBox.Show("Registeration Complete");
                this.Close();
            }
        }