private void button_Click(object sender, RoutedEventArgs e)
        {
            adminoptions o = new adminoptions();

            o.Show();
            this.Hide();
        }
Exemple #2
0
        private void button2_Click(object sender, RoutedEventArgs e)
        {
            adminoptions ao = new adminoptions();

            ao.Show();
            this.Close();
        }
Exemple #3
0
        private void back_Click(object sender, RoutedEventArgs e)
        {
            adminoptions cccc = new adminoptions();

            cccc.Show();
            this.Close();
        }
Exemple #4
0
 private void button_Click(object sender, RoutedEventArgs e)
 {
     if (Loginas.bu == "yes")
     {
         if (employeelogin.Notification == true || employeelogin.depnoti == true || employeelogin.salnoti == true)
         {
             ggg = true;
             adminoptionNotification s = new adminoptionNotification();
             s.Show();
             this.Close();
         }
         else
         {
             ggg = true;
             adminoptions s = new adminoptions();
             s.Show();
             this.Close();
         }
     }
     else
     {
         if (employeelogin.Notification == true || employeelogin.depnoti == true || employeelogin.salnoti == true)
         {
             AccountingoptionNotification aa = new AccountingoptionNotification();
             aa.Show();
             this.Close();
         }
         else
         {
             AccountingOptionForm aa = new AccountingOptionForm();
             aa.Show();
             this.Close();
         }
     }
 }
        private void button2_Click_1(object sender, RoutedEventArgs e)
        {
            bool valid = false;

            for (int i = 0; i < Containers.Employee_list.Count; i++)
            {
                if (Containers.Employee_list[i].getId() == login.Text && Containers.Employee_list[i].Getpassword() == passwordBox.Password)
                {
                    MessageBox.Show("Login Successfuly.");
                    if (Containers.Employee_list[i].GetDepartment() == "HR")
                    {
                        adminoptions optionform = new adminoptions();
                        optionform.Show();
                        this.Close();
                    }
                    else if (Containers.Employee_list[i].GetDepartment() == "Accounting")
                    {
                        AccountingOptionForm af = new AccountingOptionForm();
                        af.Show();
                    }
                    this.Close();
                    valid = true;
                    break;
                }
            }
            if (!valid)
            {
                MessageBox.Show("Wrong E-mail or Password!");
            }
        }
        private void notification_Click(object sender, RoutedEventArgs e)
        {
            if (Edit_Department.dep == true)
            {
                MessageBox.Show("Welcom to your new department :)");
            }
            if (Edit_DepartmentSalaryBonus.sal == true)
            {
                MessageBox.Show("Check your new salary !");
            }
            if (employeelogin.Notification)
            {
                MessageBox.Show("Please send your medical report !");
            }
            adminoptions ao = new adminoptions();

            ao.Show();
            this.Close();
        }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            bool valid = false;

            for (int i = 0; i < Containers.Admin_list.Count; i++)
            {
                if (Containers.Admin_list[i].getusername() == textBox.Text && Containers.Admin_list[i].getuserPassword() == passwordBox.Password)
                {
                    MessageBox.Show("Login Successfuly!");

                    adminoptions optionform = new adminoptions();
                    optionform.Show();

                    admin = true;
                    this.Close();
                    valid = true;
                    break;
                }
            }
            if (!valid)
            {
                MessageBox.Show("Wrong User-name or Password!");
            }
        }
Exemple #8
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            bool found = false;

            if (textBox.Text == "" || password.Text == "")
            {
                MessageBox.Show("Please fill the required information !");
            }
            else if (password.Text.Length < 6)
            {
                MessageBox.Show("Password Is Too Short !");
            }
            else if (textBox.Text == password.Text)
            {
                MessageBox.Show("Enter Diffrent Password ");
            }
            else
            {
                for (int i = 0; i < Containers.Employee_list.Count; i++)
                {
                    if (Containers.Employee_list[i].getId().ToString() == employeelogin.loginid)
                    {
                        if (Containers.Employee_list[i].Getpassword() == textBox.Text)
                        {
                            found = true;
                            Containers.Employee_list[i].setpassword(password.Text);
                        }
                    }
                }

                if (found == false)
                {
                    MessageBox.Show("Wrong Password ");
                }
                else
                {
                    if (File.Exists("Employees.xml"))
                    {
                        File.Delete("Employees.xml");
                    }

                    for (int i = 0; i < Containers.Employee_list.Count; i++)
                    {
                        Containers.write_Employee(Containers.Employee_list[i]);
                    }
                    MessageBox.Show("Changes Done");
                    if (Loginas.bu == "yes")
                    {
                        if (employeelogin.Notification == true || employeelogin.depnoti == true || employeelogin.salnoti == true)
                        {
                            ggg = true;
                            adminoptionNotification s = new adminoptionNotification();
                            s.Show();
                            this.Close();
                        }
                        else
                        {
                            ggg = true;
                            adminoptions s = new adminoptions();
                            s.Show();
                            this.Close();
                        }
                    }
                    else
                    {
                        if (employeelogin.Notification == true || employeelogin.depnoti == true || employeelogin.salnoti == true)
                        {
                            AccountingoptionNotification aa = new AccountingoptionNotification();
                            aa.Show();
                            this.Close();
                        }
                        else
                        {
                            AccountingOptionForm aa = new AccountingOptionForm();
                            aa.Show();
                            this.Close();
                        }
                    }
                }
            }
        }
        private void button2_Click_1(object sender, RoutedEventArgs e)
        {
            bool valid = false;

            loginid   = login.Text;
            loginpass = passwordBox.Password;
            for (int i = 0; i < Containers.Employee_list.Count; i++)
            {
                if (Containers.Employee_list[i].getId() == login.Text)
                {
                    if (Containers.Employee_list[i].GetDepartment() == "Coach")
                    {
                        empid = true;
                    }
                }
            }
            bool x = false, y = false;

            for (int i = 0; i < Containers.Employee_list.Count; i++)
            {
                if (Containers.Employee_list[i].getId() == login.Text && Containers.Employee_list[i].Getpassword() == passwordBox.Password)
                {
                    if (Containers.Employee_list[i].GetDepartment() == "Accounting")
                    {
                        if (Loginas.bu == "yes")
                        {
                            x = true;
                            break;
                        }
                    }
                }
            }
            for (int i = 0; i < Containers.Employee_list.Count; i++)
            {
                if (Containers.Employee_list[i].GetDepartment() == "HR")
                {
                    if (Containers.Employee_list[i].getId() == login.Text && Containers.Employee_list[i].Getpassword() == passwordBox.Password)
                    {
                        if (Loginas.au == "yes")
                        {
                            y = true;
                            break;
                        }
                    }
                }
            }
            if (x == true || y == true)
            {
                MessageBox.Show("Wrong ID or Password");
            }
            else
            {
                for (int i = 0; i < Containers.Employee_list.Count; i++)
                {
                    if (Containers.Employee_list[i].getId() == login.Text && Containers.Employee_list[i].Getpassword() == passwordBox.Password)
                    {
                        Containers.Employee_list[i].setStatus("YES");
                        if (Containers.Employee_list[i].getMedicalReport() == "NO")
                        {
                            Notification = true;
                        }

                        if (Containers.Employee_list[i].getdepnot() == "YES")
                        {
                            depnoti = true;
                            Containers.Employee_list[i].setdepnot("NO");
                        }
                        if (Containers.Employee_list[i].getsalarynot() == "YES")
                        {
                            salnoti = true;
                            Containers.Employee_list[i].setsalarynot("NO");
                        }
                        if (Containers.Employee_list[i].GetDepartment() == "Coach")
                        {
                            break;
                        }
                        MessageBox.Show("Login Successfuly.");
                        if (Containers.Employee_list[i].GetDepartment() == "HR")
                        {
                            if (login.Text == passwordBox.Password)
                            {
                                Edit_EmployeePassword eee = new Edit_EmployeePassword();
                                eee.Show();
                            }
                            else
                            {
                                if (Notification == true || depnoti == true || salnoti == true)
                                {
                                    adminoptionNotification oo = new adminoptionNotification();
                                    hrid = true;
                                    oo.Show();
                                }
                                else
                                {
                                    adminoptions oo = new adminoptions();
                                    hrid = true;
                                    oo.Show();
                                }
                            }
                            this.Close();
                        }
                        else if (Containers.Employee_list[i].GetDepartment() == "Accounting")
                        {
                            if (login.Text == passwordBox.Password)
                            {
                                Edit_EmployeePassword eee = new Edit_EmployeePassword();
                                eee.Show();
                            }
                            else
                            {
                                if (Notification == true || depnoti == true || salnoti == true)
                                {
                                    AccountingoptionNotification af = new AccountingoptionNotification();
                                    af.Show();
                                }
                                else
                                {
                                    AccountingOptionForm af = new AccountingOptionForm();
                                    af.Show();
                                }
                            }
                            this.Close();
                        }

                        valid = true;
                        break;
                    }
                }

                if (File.Exists("Employees.xml"))
                {
                    File.Delete("Employees.xml");
                }

                for (int i = 0; i < Containers.Employee_list.Count; i++)
                {
                    Containers.write_Employee(Containers.Employee_list[i]);
                }
                if (!valid)
                {
                    MessageBox.Show("Wrong ID or Password!");
                }
            }
        }