Ejemplo n.º 1
0
 private void bunifuThinButton21_Click(object sender, EventArgs e)
 {
     if (metroComboBox1.Text == "Manager")
     {
         if (metroComboBox2.Text != "")
         {
             ManagerData md = new ManagerData();
             if (md.UpdateManager(this.clickId, metroTextBox1.Text, Convert.ToInt32(metroTextBox4.Text), metroComboBox2.Text, metroTextBox3.Text) == true)
             {
                 MessageBox.Show("Manager Updated", "Success");
                 Init();
             }
             else
             {
                 MessageBox.Show("Please check again.", "Error");
                 Init();
             }
         }
         else
         {
             MessageBox.Show("Please Select Department", "Error");
             Init();
         }
     }
     if (metroComboBox1.Text == "Employee")
     {
         if (metroComboBox2.Text != "")
         {
             EmployeeData ed = new EmployeeData();
             PaymentData  pd = new PaymentData();
             if (ed.UpdateEmployee(this.clickId, metroTextBox1.Text, Convert.ToInt32(metroTextBox4.Text), metroComboBox2.Text, metroTextBox3.Text) == true)
             {
                 if (pd.UpdateEmployeePayment(this.clickId, metroTextBox1.Text, Convert.ToInt32(metroTextBox4.Text), metroTextBox3.Text) == true)
                 {
                     MessageBox.Show("Employee Updated", "Success");
                     Init();
                 }
             }
             else
             {
                 MessageBox.Show("Please check again.", "Error");
                 Init();
             }
         }
         else
         {
             MessageBox.Show("Please Select Department", "Error");
             Init();
         }
     }
 }