예제 #1
0
        private void btnClient_Click(object sender, EventArgs e)
        {
            ClientManagementDepartment cmd = new ClientManagementDepartment();

            this.Hide();
            cmd.Show();
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string username = txtUsername.Text;
            string password = txtPassword.Text;

            if (username != "" && password != "")
            {
                foreach (var item in accessList)
                {
                    if (username == item.Username && password == item.Password)
                    {
                        holder = "Allow Access";
                    }
                }
            }
            else
            {
                MessageBox.Show("All credentials are required", "Warning", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning);
            }
            string name  = txtUsername.Text.Substring(0, 1).ToUpper();
            string whole = txtUsername.Text.Substring(1);

            if (holder == "Allow Access")
            {
                ClientManagementDepartment CMD = new ClientManagementDepartment();
                CMD.Show();
                this.Hide();
                MessageBox.Show("Welcome to the Client Management System  " + name + whole + "  ", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Wrong Credentials", "Warning", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning);
            }
        }