Пример #1
0
        public void loadEmployee(EmployeeItem employee)
        {
            String query = "select * from users where `employeeID`=\"" + employee + "\"";
            DataTable loadedClient = database.GetTable(query);

            EmpName.Text = employee.employeeName;

            if (employee.superUser)
                EmpAdmin.Checked = true;
            else
                EmpAdmin.Checked = false;

            if (employee.promptOnLogin)
                EmpPrompt.Checked = true;
            else
                EmpPrompt.Checked = false;
        }
Пример #2
0
        public void updateEmployeeList()
        {
            employeeList.Items.Clear();
            String query = "select * from users where `Active`=true";
            employees = database.GetTable(query);

            DataTable employeeTable = employees;
            foreach (DataRow row in employeeTable.Rows)
            {
                EmployeeItem item = new EmployeeItem();
                item.id = row["employeeID"].ToString();
                item.employeeName = row["name"].ToString();
                item.superUser = Convert.ToBoolean(row["superUser"].ToString());
                item.promptOnLogin = Convert.ToBoolean(row["PasswordPromptOnLogin"].ToString());
                employeeList.Items.Add(item);
            }
            employeeList.SetSelected(0, true);
        }
Пример #3
0
        private void updateLog(EmployeeItem employee)
        {
            String query = "select timestamp, message from AdminLog where empID=" + employee.id + " order by timestamp desc";
            logTable = database.GetTable(query);

            if (logTable.Rows.Count > 0)
            {
                adminLog.Visible = true;
                adminLog.DataSource = logTable;
                adminLog.Refresh();
            }
            else
            {
                adminLog.Visible = false;
            }
        }