private void FormMain_Load(object sender, EventArgs e) { if (controllerProfile.Authentication()) { controller.AccessLevel(ControllerProfile.User); MessageBox.Show("Good day, " + ControllerProfile.User.Login, "Authorization was successful", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { FormLogin formLogin = new FormLogin(); formLogin.MdiParent = this; formLogin.Show(); } }
private void FormMain_Load(object sender, EventArgs e) { if (controllerProfile.Authentication()) { controller.AccessLevel(ControllerProfile.User); MessageBox.Show("Добрий день, " + ControllerProfile.User.Login, "Авторизація пройшла успішно", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { FormLogin formLogin = new FormLogin(); formLogin.MdiParent = this; formLogin.Show(); } }
private void btnEnter_Click(object sender, EventArgs e) { //Person currentuser= new Person(); if (controller.Authentication(tBLogin.Text, tbPassword.Text)) { MessageBox.Show("Добрий день, " + ControllerProfile.User.Login, "Авторизація пройшла успішно", MessageBoxButtons.OK, MessageBoxIcon.Information); controller.SaveRegister(); ((FormMain)(MdiParent)).controller.AccessLevel(ControllerProfile.User); Close(); } else { MessageBox.Show("Дані введені невірно", "Помилка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnEnter_Click(object sender, EventArgs e) { //Person currentuser= new Person(); if (controller.Authentication(tBLogin.Text, tbPassword.Text)) { MessageBox.Show("Good day, " + ControllerProfile.User.Login, "Authorization was successful", MessageBoxButtons.OK, MessageBoxIcon.Information); controller.SaveRegister(); ((FormMain)(MdiParent)).controller.AccessLevel(ControllerProfile.User); Close(); } else { MessageBox.Show("Data entered incorrectly", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }