private void metroButton1_Click(object sender, EventArgs e) { if (clientid != string.Empty && cmbClientType.Text != string.Empty) { Call_Centre call = new Call_Centre(username, surname, clientid, cmbClientType.Text); this.Close(); call.Show(); } else { Message += new Display.myDelegate(Display.Error); Message.Invoke(); } }
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"); } }
private void btnCallCentre_Click(object sender, EventArgs e) { Call_Centre callCentre = new Call_Centre(ename, esurname); callCentre.Show(); }