Example #1
0
        private void loginBtn_Click(object sender, EventArgs e)
        {
            if (comboBoxUser.SelectedItem.ToString() == "Admin")
            {
                if ((txtUser.Text == "admin") && (txtPass.Text == "admin"))
                {
                    frmAdmin admin = new frmAdmin();
                    admin.Show();
                    clsGlobal.currentUser = "******";
                }
                else
                {
                    if (MessageBox.Show("Your Username or Password is incorrect!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
                    {
                        txtUser.Focus();
                    }
                }
            }
            else if (comboBoxUser.SelectedItem.ToString() == "Client")
            {
                foreach (DataRow myRow in tabClients.Rows)
                {
                    if ((txtUser.Text == myRow["ClientName"].ToString()) && txtPass.Text == myRow["ClientPass"].ToString())
                    {
                        clsGlobal.currentClient = myRow["ClientId"].ToString();

                        frmClients client = new frmClients();
                        client.Show();
                    }
                }
            }

            else
            {
                foreach (DataRow myRow in tabAgents.Rows)
                {
                    if ((txtUser.Text == myRow["AgentName"].ToString()) && txtPass.Text == myRow["AgentPass"].ToString())
                    {
                        clsGlobal.currentAgent = myRow["AgentEmpNum"].ToString();
                        clsGlobal.currentUser  = "******";
                        frmAgents agent = new frmAgents();
                        agent.Show();
                    }
                }
            }
        }
Example #2
0
        private void lblGuest_Click(object sender, EventArgs e)
        {
            frmClients fc = new frmClients();

            fc.Show();
        }