Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string email    = textBox1.Text;
                string password = textBox2.Text;


                if (email == string.Empty)
                {
                    MessageBox.Show("Please enter your email");
                    return;
                }

                if (password == string.Empty)
                {
                    MessageBox.Show("Please enter your password");
                    return;
                }


                Receptionist r = new Receptionist();


                r.Email1    = email;
                r.Password1 = password;

                int result = r.AddPerson(r);
                if (result > 0)
                {
                    textBox1.Text = "";
                    textBox2.Text = "";
                    if (email == "pinar" && password == "2317")
                    {
                        MessageBox.Show("Welcome Pınar");
                        EmployeeScreen Employees = new EmployeeScreen();
                        Employees.Show();
                        this.Hide();
                    }
                    else if (email == "seyma" && password == "0506")
                    {
                        MessageBox.Show("Welcome Şeyma");
                        EmployeeScreen Employees = new EmployeeScreen();
                        Employees.Show();
                        this.Hide();
                    }
                    else if (email == "hilal" && password == "2525")
                    {
                        MessageBox.Show("Welcome Hilal");
                        EmployeeScreen Employees = new EmployeeScreen();
                        Employees.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Please try again");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }