Exemple #1
0
        private void bunifuThinButton23_Click(object sender, EventArgs e)
        {
            if (metroComboBox1.SelectedIndex.ToString() == "0")
            {
                ManagerData md = new ManagerData();
                if (md.InsertManager(metroTextBox1.Text, metroTextBox2.Text, Convert.ToInt32(metroTextBox4.Text), metroComboBox2.Text, metroTextBox3.Text) == true)
                {
                    MessageBox.Show("Manager Added", "Success");
                    Init();
                }
                else
                {
                    MessageBox.Show("Please Check All The Info Was Correct", "Error");
                }
            }
            if (metroComboBox1.SelectedIndex.ToString() == "1")
            {
                PaymentData  pd = new PaymentData();
                EmployeeData ed = new EmployeeData();

                if (ed.InsertEmployee(metroTextBox1.Text, metroComboBox2.Text, Convert.ToInt32(metroTextBox4.Text), metroComboBox2.Text, metroTextBox3.Text) == true)
                {
                    if (pd.InsertEmployee(metroTextBox1.Text, Convert.ToInt32(metroTextBox4.Text), metroTextBox3.Text) == true)
                    {
                        MessageBox.Show("Employee Added", "Success");
                        Init();
                    }
                }
                else
                {
                    MessageBox.Show("Please Check All The Info Was Correct", "Error");
                }
            }
        }