private void BtnLogIn_Click(object sender, EventArgs e) { string email = this.TxtEmail.Text; string password = this.TxtPassword.Text; try { if (RdoColaborator.Checked) { instance.Session = instance.SessionHandler.LogInColaborator(email, password); ColaboratorUI colaboratorUI = new ColaboratorUI(); colaboratorUI.Show(); this.Hide(); } else if (RdoAdmin.Checked) { instance.Session = instance.SessionHandler.LogInAdministrator(email, password); AdministratorUI administratorUI = new AdministratorUI(); administratorUI.Show(); this.Hide(); } } catch (UserException ex) { String msgError = ex.Message; MessageBox.Show(msgError, "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void BtnCancel_Click(object sender, EventArgs e) { Type typeOfUser = instance.Session.user.GetType(); if (typeOfUser.Equals(typeof(Administrator))) { AdministratorUI administratorUI = new AdministratorUI(); administratorUI.Show(); this.Hide(); } else { ColaboratorUI colaboratorUI = new ColaboratorUI(); colaboratorUI.Show(); this.Hide(); } }