private DABAcceptMaterialCall.Response DABAcceptMaterialCallHandler(DABAcceptMaterialCall command)
        {
            DABAcceptMaterialCall.Response response = new DABAcceptMaterialCall.Response();

            var getInput = new AcceptMaterialCall
            {
                Id         = command.Id,
                TeamLeader = command.TeamLeader
            };

            var getResponse = Platform.CallCommand <AcceptMaterialCall, AcceptMaterialCall.Response>(getInput);

            if (!getResponse.Succeeded)
            {
                response.SetError(getResponse.Error.ErrorCode, getResponse.Error.ErrorMessage);
            }

            return(response);
        }
        private AcceptMaterialCall.Response AcceptMaterialCallHandler(AcceptMaterialCall command)
        {

            var response = new AcceptMaterialCall.Response();
            //var materialCall = Platform.Query<IMaterialCall>().FirstOrDefault(t => t.Id == command.Id);

            var materialCall = Platform.GetEntity<IMaterialCall>(command.Id);

            if (materialCall != null)
            {
                materialCall.TeamLeader = command.TeamLeader;
                materialCall.Accepted = true;
                materialCall.AcceptDate = DateTime.UtcNow;
               
                Platform.Submit(materialCall);
                Platform.FireEvent(new UpdateAndon { WorkArea = materialCall.WorkArea });
            }
            else response.SetError(104, "MaterialCall non trovata!");

            return response;
        }