public EmployeeLogic(
     IEmployeeService employeeService,
     IEmployeeQuery employeeQuery)
 {
     this.employeeService = employeeService;
     this.employeeQuery   = employeeQuery;
 }
Exemple #2
0
    public List <string> QueryEmployeeNames()
    {
        try
        {
            IMsgSetRequest requestSet = SessionManager.Instance.CreateMsgSetRequest();
            requestSet.Attributes.OnError = ENRqOnError.roeStop;
            IEmployeeQuery employeeQuery = requestSet.AppendEmployeeQueryRq();

            IMsgSetResponse responeSet   = SessionManager.Instance.DoRequests(requestSet);
            IResponseList   responseList = responeSet.ResponseList;

            List <string> employeeNames = new List <string>();

            for (int i = 0; i < responseList.Count; i++)
            {
                IResponse response = responseList.GetAt(i);
                if (response.StatusCode == 0)
                {
                    IEmployeeRetList employeeList = (IEmployeeRetList)response.Detail;
                    for (int j = 0; j < employeeList.Count; j++)
                    {
                        IEmployeeRet employee = employeeList.GetAt(j);
                        employeeNames.Add(employee.Name.GetValue());
                    }
                }
            }

            return(employeeNames);
        }
        catch (Exception ex)
        {
            // Handle exception
        }
    }
Exemple #3
0
 public EmployeeTest()
 {
     employeeController = new EmployeeController();
     responseClient     = Substitute.For <IResponseClient>();
     employeeService    = Substitute.For <IEmployeeService>();
     employeeQuery      = Substitute.For <IEmployeeQuery>();
     employeeLogic      = new EmployeeLogic(employeeService, employeeQuery);
 }
Exemple #4
0
 private void Inicializer()
 {
     employeeService = EmployeeService.GetInstance();
     employeeQuery   = EmployeeQuery.GetInstance();
     employeeLogic   = EmployeeLogic.GetInstance(employeeService, employeeQuery);
     responseClient  = ResponseClient.GetInstance();
     errorMessage    = null;
 }
Exemple #5
0
 public EmployeesController(IMapper mapper,
                            IEmployeeQuery employeeQuery,
                            IEmployeeRepository employeeRepository)
 {
     _mapper             = mapper;
     _employeeQuery      = employeeQuery;
     _employeeRepository = employeeRepository;
 }
Exemple #6
0
        public async Task <ActionResult> Get(int id, [FromServices] IEmployeeQuery employeeQuery, CancellationToken cancellationToken)
        {
            var result = await employeeQuery.Get(id, cancellationToken);

            if (result == null)
            {
                return(NotFound());
            }
            return(Ok(detailedEmployeeMapper.Map(result)));
        }
        public static IEmployeeLogic GetInstance(
            IEmployeeService employeeService,
            IEmployeeQuery employeeQuery)
        {
            if (Interface != null)
            {
                return(Interface);
            }

            return(new EmployeeLogic(employeeService, employeeQuery));
        }
 public GetMeetingsTests()
 {
     _meetingQuery  = A.Fake <IMeetingQuery>();
     _employeeQuery = A.Fake <IEmployeeQuery>();
     _host          = new HostBuilder()
                      .ConfigureWebHost(webBuilder =>
     {
         webBuilder
         .UseTestServer()
         .Configure(app => { })
         .UseStartup <Startup>()
         .ConfigureTestServices(services =>
         {
             services.AddTransient(provider => _employeeQuery)
             .AddTransient(provider => _meetingQuery);
         });
     })
                      .Start();
     _client = _host.GetTestClient();
 }
Exemple #9
0
 public EmployeeController(ICommandBus commandBus, IEmployeeQuery employeeQuery)
 {
     _commandBus    = commandBus;
     _employeeQuery = employeeQuery;
 }
Exemple #10
0
 public EmployeeController(ICommandBus commandBus, IEmployeeQuery employeeQuery)
 {
     _commandBus = commandBus;
     _employeeQuery = employeeQuery;
 }
Exemple #11
0
 public UpdateEmployeeNameHandler(IEmployeeRepository employeeRepository,
                                  IEmployeeQuery employeeQuery)
 {
     this.employeeRepository = employeeRepository;
     this.employeeQuery      = employeeQuery;
 }
 public MeetingController(IEmployeeQuery employeeQuery, IMeetingQuery meetingQuery, IValidator <SuitableMeetingsRequest> validator)
 {
     _employeeQuery = employeeQuery;
     _meetingQuery  = meetingQuery;
     _validator     = validator;
 }
 public EmployeeController(IEmployeeCommand employeeCommand, IEmployeeQuery employeeQuery)
 {
     _employeeCommand = employeeCommand;
     _employeeQuery   = employeeQuery;
 }
Exemple #14
0
 /// <summary>
 /// Initialize
 /// </summary>
 /// <param name="mediator"></param>
 /// <param name="employeeQuery"></param>
 public EmployeeController(IMediator mediator, IEmployeeQuery employeeQuery)
 {
     _mediator      = mediator ?? throw new ArgumentNullException(nameof(mediator));
     _employeeQuery = employeeQuery ?? throw new ArgumentNullException(nameof(employeeQuery));
 }
Exemple #15
0
        public async Task <ActionResult> Get([FromServices] IEmployeeQuery employeeQuery, CancellationToken cancellationToken)
        {
            var result = await employeeQuery.Get(cancellationToken);

            return(Ok(resumedEmployeeMapper.Map(result)));
        }
Exemple #16
0
 public ChangeSalaryHandler(IEmployeeQuery employeeQuery,
                            IWageRepository wageRepository)
 {
     this.employeeQuery  = employeeQuery;
     this.wageRepository = wageRepository;
 }