private void button1_Click(object sender, EventArgs e) { string login = textBox1.Text; string password = textBox2.Text; correctInput = new CorrectInputCheck(); bd = new BD(); if (correctInput.CheckLogPas(login, password)) { if (correctInput.CorrectInputLogin(login)) { if (bd.AuthCheck(login, password)) { switch (bd.AccessCheck(login)) { case "Admin": { adm = new AdmWin(this); adm.Show(); clearFields(); Hide(); break; } case "Consultant": { consult = new ConsultForm(this); consult.Show(); clearFields(); Hide(); break; } case "Guest": { guest = new GuestForm(this, login, password); guest.Show(); clearFields(); Hide(); break; } default: errorList.ErrorMessage("Unknow access!!!"); break; } } else { errorList.ErrorMessage(13); } } } }
private void button1_Click(object sender, EventArgs e) { string login = textBox1.Text; string pass = textBox2.Text; if (inputCheck.CheckLogPas(login, pass)) { if (inputCheck.CorrectInputLogin(login) && inputCheck.LoginExist(login)) { string req = String.Format("INSERT INTO Accounts (Login, Password, Access) " + "VALUES ('{0}', '{1}', 'Consultant')", login, pass); bd.WorkWithBD(req); bd.ViewAllAcc(listBox1); textBox1.Text = ""; textBox2.Text = ""; } } }
private void button4_Click(object sender, EventArgs e) { string login = textBox1.Text; string password = textBox2.Text; correctInput = new CorrectInputCheck(); bd = new BD(); seccess = new SeccessList(); if (correctInput.CheckLogPas(login, password)) { if (correctInput.CorrectInputLogin(login)) { if (correctInput.LoginExist(login)) { bd.WorkWithBD(String.Format("INSERT INTO Accounts VALUES('{0}','{1}','{2}',{3})", login, password, "Guest", correctInput.BucketIdGen())); seccess.SeccessMessage(2); } } } }