示例#1
0
        public bool HandleRequest()
        {
            switch (EventArgument)
            {
            case EventArgumentEnum.Create:
                return(_manager.Create(Entity));

            case EventArgumentEnum.Read:
                switch (EventCommand)
                {
                case EventCommandEnum.Get:
                    Entity = _manager.Get(Entity);
                    return(true);

                case EventCommandEnum.Details:
                    Entity.Paycheck = _manager.GetPaycheck(Entity);
                    return(true);
                }
                break;

            case EventArgumentEnum.Update:
                switch (EventCommand)
                {
                case EventCommandEnum.Get:
                    Entity.Paycheck = _manager.GetPaycheck(Entity);
                    return(true);

                case EventCommandEnum.Edit:
                    return(_manager.Edit(Entity));
                }
                break;

            case EventArgumentEnum.Delete:
                switch (EventCommand)
                {
                case EventCommandEnum.Get:
                    Entity.Paycheck = _manager.GetPaycheck(Entity);
                    return(true);

                case EventCommandEnum.Delete:
                    return(_manager.Delete(Entity.Paycheck));
                }
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(false);
        }