private void lblHome_Click(object sender, EventArgs e)
        {
            AdminHomeForm home = new AdminHomeForm(userDataTable);

            home.Show();
            this.Hide();
        }
        private void addWorker()
        {
            if (isValidated() && isUnique())
            {
                Users user = setUsers();

                int       affectedRowCount = dataAccess.Insert <Users>(user, true);
                DataTable userTable        = dataAccess.GetData <Users>($"where UserName = '******' and Password = '******'");

                if (affectedRowCount > 0)
                {
                    Employee employee = setEmployee(userTable);

                    affectedRowCount = dataAccess.Insert <Employee>(employee, true);

                    if (affectedRowCount > 0)
                    {
                        MessageBox.Show("Worker Added Successfully");
                        AdminHomeForm adminHome = new AdminHomeForm(userTable);
                        adminHome.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Something Went Wrong!!!");
                    }
                }
                else
                {
                    MessageBox.Show("Unable to Add worker!!!");
                }
            }
        }
        private void addBranch()
        {
            Branch branch = new Branch()
            {
                Branch_Name = txtBranchName.Text,
                Address     = txtAddress.Text,
                UpdatedDate = DateTime.Now
            };
            int rowsAffected = dataAcess.Insert <Branch>(branch, true);

            if (rowsAffected > 0)
            {
                MessageBox.Show("New Branch Added Successfully");
                AdminHomeForm adminHome = new AdminHomeForm(userDataTable);
                adminHome.Show();
                this.Hide();
            }
        }
        private void login()
        {
            if (isEmpty())
            {
                DataTable userTable;
                userTable = dataAccess.GetData <Users>($"where UserName = '******' and Password = '******'");

                if (userTable.Rows.Count > 0)
                {
                    if (userTable.Rows[0].Field <int>("UserType") == (int)Users.UserTypeEnum.Admin)
                    {
                        AdminHomeForm adminHome = new AdminHomeForm(userTable);
                        adminHome.Show();
                        this.Hide();
                    }
                    else if (userTable.Rows[0].Field <int>("UserType") == (int)Users.UserTypeEnum.Employee)
                    {
                        if (userTable.Rows[0].Field <bool>("Information_given"))
                        {
                            DataTable employeeTable = dataAccess.GetData <Employee>($"where User_id = '{userTable.Rows[0].Field<int>("id")}'");
                            if (employeeTable.Rows[0].Field <int>("Designation") == (int)Employee.DesignationEnum.Manager)
                            {
                                EmpHomeForm employeeHome = new EmpHomeForm(userTable);
                                employeeHome.Show();
                                this.Hide();
                            }
                            else
                            {
                                MessageBox.Show("You are not a manager So you can't Login to the home page!!!");
                            }
                        }
                        else
                        {
                            EmpRegistration employeeRegistration = new EmpRegistration(userTable);
                            employeeRegistration.Show();
                            this.Hide();
                        }
                    }
                    else if (userTable.Rows[0].Field <int>("UserType") == (int)Users.UserTypeEnum.Customer)
                    {
                        DataTable customerTable = dataAccess.GetData <Customers>($"where User_Id = '{userTable.Rows[0].Field<int>("Id")}'");
                        if (customerTable.Rows[0].Field <bool>("Is_verified"))
                        {
                            CustHomeForm customeerHome = new CustHomeForm(userTable);
                            customeerHome.Show();
                            this.Hide();
                        }
                        else
                        {
                            MessageBox.Show("Please wait for verification");
                        }
                    }
                }
                else
                {
                    MessageBox.Show("UserName or Password is not correct!!!");
                    errorProvider1.SetError(txtUserName, "User Name maybe wrong!!!");
                    errorProvider1.SetError(txtPassword, "Password Maybe wrong!!!");
                }
            }
        }