Exemplo n.º 1
0
        public DeductRounds(int pID, EmployeeWindow pEmployeeWindow)
        {
            InitializeComponent();
            employeeWindow = pEmployeeWindow;
            // Grabs the residents current rounds
            for (int i = 0; i < Database.ResidentInfo.Count; i++)
            {
                if (Database.ResidentInfo[i].ID == pID)
                {
                    lblCurrenRounds.Text = Database.ResidentInfo[i].CurrentRounds + "";
                    currentRounds        = Database.ResidentInfo[i].CurrentRounds;
                    resIndex             = i;
                }
            }

            foreach (EmployeeInfo employee in Database.EmployeeInfo)
            {
                if (employee.IsCurrent)
                {
                    cmbEmployee.Items.Add(employee.FirstName + " " + employee.LastName);
                }
            }

            cmbEmployee.Text = Database.LoggedInEmployee.FirstName + " " + Database.LoggedInEmployee.LastName;
        }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            bool login = Database.Login(txtUsername.Text, txtPassword.Text);

            if (login)
            {
                employeeScreen         = new EmployeeWindow(this);
                employeeScreen.Visible = true;
                txtUsername.Text       = "";
                txtPassword.Text       = "";
                this.Hide();
            }
            else
            {
                MessageBox.Show("Wrong Username or password");
            }
        }