public override void HandleNotification(INotification note) { UserVO user; RoleVO role; string userName; switch (note.Name) { case NotiConst.NEW_USER: RolePanel.ClearForm(); break; case NotiConst.USER_ADDED: user = (UserVO)note.Body; userName = user == null ? "" : user.UserName; role = new RoleVO(userName); roleProxy.AddItem(role); RolePanel.ClearForm(); break; case NotiConst.USER_UPDATED: RolePanel.ClearForm(); break; case NotiConst.USER_DELETED: RolePanel.ClearForm(); break; case NotiConst.CANCEL_SELECTED: RolePanel.ClearForm(); break; case NotiConst.USER_SELECTED: user = (UserVO)note.Body; userName = user == null ? "" : user.UserName; RolePanel.ShowUser(user, roleProxy.GetUserRoles(userName)); break; case NotiConst.ADD_ROLE: userName = RolePanel.User == null ? "" : RolePanel.User.UserName; RolePanel.ShowUserRoles(roleProxy.GetUserRoles(userName)); break; case NotiConst.DEL_ROLE: userName = RolePanel.User == null ? "" : RolePanel.User.UserName; RolePanel.ShowUserRoles(roleProxy.GetUserRoles(userName)); break; } }
override public void HandleNotification(INotification note) { switch (note.Name) { case ApplicationFacade.NEW_USER: ClearForm(); break; case ApplicationFacade.USER_ADDED: RolePanel.User = note.Body as UserVo; RoleVo roleVO = new RoleVo(RolePanel.User.Username, new ObservableCollection <RoleEnum>()); RoleProxy.AddItem(roleVO); ClearForm(); break; case ApplicationFacade.USER_UPDATED: ClearForm(); break; case ApplicationFacade.USER_DELETED: ClearForm(); break; case ApplicationFacade.CANCEL_SELECTED: ClearForm(); break; case ApplicationFacade.USER_SELECTED: RolePanel.User = note.Body as UserVo; RolePanel.UserRoles = RoleProxy.GetUserRoles(RolePanel.User.Username); RolePanel.RoleCombo.SelectedItem = RoleEnum.NONE_SELECTED; RolePanel.IsEnabled = true; RolePanel.RemoveButton.IsEnabled = false; RolePanel.AddButton.IsEnabled = false; break; } }