private void txtRegister_Click(object sender, EventArgs e) { //Check to see if credentials are inputted correctly String uname = txtUName.Text; String pword = txtPWord.Text; DBController dbc = new DBController(); if (dbc.createUser(uname, pword) == "incorrect") { lblError.Text = "Please input the correct credentials"; uname = ""; pword = ""; txtUName.Text = ""; txtPWord.Text = ""; } else { Manager man = new Manager(uname); txtUName.Text = ""; txtPWord.Text = ""; man.ShowDialog(); } }
private void btnLogin_Click_1(object sender, EventArgs e) { String uname = txtUName.Text; String pword = txtPWord.Text; DBController dbc = new DBController(); //Create method to check if user exists in DB or not if (dbc.logInUser(uname, pword) == "incorrect") { lblError.Text = "Please input the correct credentials"; uname = ""; pword = ""; txtUName.Text = ""; txtPWord.Text = ""; } else if (dbc.logInUser(uname, pword) == "success") { Manager man = new Manager(uname); man.Show(); } else lblError.Text = "Log in not sucessfull"; }