private void btnLogin_Click(object sender, EventArgs e) { Dictionary <string, dynamic> data = new Dictionary <string, dynamic>(); data["username"] = txtUserName.Text.TrimStart().TrimEnd(); data["password"] = txtPassword.Text.TrimStart().TrimEnd(); LoginCtrl lgnCtrl = new LoginCtrl(); lgnCtrl.data = data; Dictionary <Object, dynamic> result = lgnCtrl.validateCredentials(); if (result["code"] == Result.Failed) { MessageBox.Show(result["msg"]); } if (result["code"] == Result.Processed) { Usuario user = result["content"]; Session session = Session.getInstance(); session.setSessionParams(user.IdUsuario.ToString(), user.Cedula, user.NombreUsuario, (user.NombreCompleto + " " + user.PrimerApellido + " " + user.SegundoApellido), user.Contrasena); new MainView().Show(); this.Hide(); } }