コード例 #1
0
    /// <summary>
    /// retrieve the user and role proxies and delete the user
    /// and his roles. then send the USER_DELETED notification
    /// </summary>
    /// <param name="notification"></param>
    public override void Execute(INotification notification)
    {
        UserVO    user      = (UserVO)notification.Body;
        UserProxy userProxy = (UserProxy)Facade.RetrieveProxy(UserProxy.NAME);

        userProxy.DeleteItem(user);
        SendNotification(EventsEnum.USER_DELETED);
    }
        ///<summary
        /// Retrieve the user and role proxies and delete the user
        /// and his roles. then send the USER_DELETED notification
        ///</summary>
        override public void Execute(INotification notification)
        {
            UserVo    user      = (UserVo)notification.Body;
            UserProxy userProxy = (UserProxy)Facade.RetrieveProxy(UserProxy.NAME);
            RoleProxy roleProxy = (RoleProxy)Facade.RetrieveProxy(RoleProxy.NAME);

            userProxy.DeleteItem(user);
            roleProxy.DeleteItem(user);
            SendNotification(ApplicationFacade.USER_DELETED);
        }
コード例 #3
0
    //复写原有的Execute执行函数
    public override void Execute(INotification notification)
    {
        //获取要删除的对象user
        UserVO user = (UserVO)notification.Body;
        //获取处理数据操作的userProxy
        UserProxy userProxy = (UserProxy)Facade.RetrieveProxy(UserProxy.NAME);

        //操作数据,删除user
        userProxy.DeleteItem(user);
        //删除完毕,广播USER_DELETED进行通知
        SendNotification(EventsEnum.USER_DELETED);
    }