Exemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (this.Theme == MetroFramework.MetroThemeStyle.Dark)
            {
                val = "dark";
            }
            else
            {
                val = "light";
            }
            log.Username = txtUsername.Text;

            log.Password = crpto.Encrypt(txtPassword.Text);
            log.Log();
            if (txtUsername.Text == string.Empty || txtPassword.Text == string.Empty)
            {
                MessageBox.Show("Please fill in all the boxes");
            }
            else if (log.Log() != string.Empty)
            {
                switch (log.Log())
                {
                case "Call_Centre":
                    this.Hide();
                    Call_Centre call = new Call_Centre(txtUsername.Text, txtPassword.Text);
                    call.Show();
                    break;

                case "Client_Maintenance":
                    this.Hide();
                    Client_Maintenance maintenance = new Client_Maintenance(val);
                    maintenance.Show();
                    break;

                case "Client_Satisfaction":
                    this.Hide();
                    Client_Satisfaction satisfaction = new Client_Satisfaction(txtUsername.Text, txtPassword.Text);
                    satisfaction.Show();
                    break;

                case "Service_Department":
                    this.Hide();
                    Service_Department service = new Service_Department();
                    service.Show();
                    break;

                case "Administrator":
                    this.Hide();
                    Home home = new Home(txtUsername.Text, txtPassword.Text, val);
                    home.Show();
                    break;

                case "Contract_Maintenance":
                    this.Hide();
                    Contract_Maintenance contract = new Contract_Maintenance();
                    contract.Show();
                    break;

                default:
                    MessageBox.Show("This user has not been assigned a department");
                    break;
                }
            }
            else
            {
                MessageBox.Show("incorrect username/password");
            }
        }
Exemplo n.º 2
0
        private void btnContractMaintenance_Click(object sender, EventArgs e)
        {
            Contract_Maintenance contractMaintenance = new Contract_Maintenance();

            contractMaintenance.Show();
        }