//if (rbutCust.Checked == true) { // if (!string.IsNullOrEmpty(txtEmail.Text) && !string.IsNullOrEmpty(txtPassword.Text)) { // ControlCustomer ctrlCustomer = new ControlCustomer(); // bool isMatched = ctrlCustomer.LoginCustomer(txtEmail.Text, txtPassword.Text); // Verificerer indtastede login-credentials gennem service. // if (isMatched == true) { // CustomerActive = ctrlCustomer.GetCustomerByEmail(txtEmail.Text); // Se fields. Customer-objekt til brug i Main.cs. // MessageBox.Show("Login succeeded!"); // this.Hide(); // Main mainForm = new Main(); // mainForm.Show(); // } else { // MessageBox.Show("Login failed!"); // } // } //} //} // CREATE ACCOUNT - ADMIN & CUSTOMER private void btnCreateAcc_Click(object sender, EventArgs e) { string chosenAdminEmail = txtEmail.Text; string chosenAdminPassword = txtPassword.Text; ControlAdmin ctrlAdmin = new ControlAdmin(); ctrlAdmin.CreateAdmin(chosenAdminEmail, chosenAdminPassword); MessageBox.Show("Admin created succesfully!"); }
public Admin CreateAdmin(Admin adminToCreate) { ControlAdmin ctrlAdmin = new ControlAdmin(); return(ctrlAdmin.CreateAdmin(adminToCreate)); }