Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            businesslayer bl = new businesslayer();

            if (CName.Text.Equals("") || Phone.Text.Equals("") || SSN.Text.Equals("") || Email.Text.Equals("") || ImagePath.Text.Equals(""))
            {
                MessageBox.Show("Please,Fill the inputs");
            }
            else
            {
                Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
                Match match = regex.Match(Email.Text);
                if (match.Success)
                {
                    bl.InsertCust(CName.Text, Phone.Text, SSN.Text, Email.Text, ImagePath.Text);
                }
                else
                {
                    MessageBox.Show(Email.Text + " is incorrect");
                }
            }
        }