/// <summary> /// Inicia una sesion para un usuario en particular /// </summary> /// <param name="user">Usuario que se esta logueando</param> public static void StartSession(User user) { User = user; if(user.Permissions.Contains(Functionalities.AdministrarRoles)) { var manager = new RolesManager(); DefaultRoleID = manager.GetDefaultRoleID(); } ViewsManager.LoadMenu(); }
public void SetUser(User user) { _updatingData = true; txtUsername.Text = user.UserName; txtUsername.Enabled = false; txtPassword.Enabled = false; txtConfirmPassword.Enabled = false; cbxProfiles.Enabled = false; if (user is Cliente) { _cliente = user as Cliente; cbxProfiles.SelectedItem = Profile.Cliente; clienteUserControl.SetUser(_cliente); } else { _proveedor = user as Proveedor; cbxProfiles.SelectedItem = Profile.Proveedor; proveedorUserControl.SetUser(_proveedor); } }
void clientesForm_OnUserSelected(object sender, UserSelectedEventArgs e) { _user = e.User; txtCliente.Text = _user.UserName; _clientesForm.Hide(); }
/// <summary> /// Cierra la sesion actual /// </summary> public static void Close() { User = null; ViewsManager.Reset(); }