public async Task LoadData(String fromDate, String minDay, String maxDay, UserTypes userType)
        {
            IsLoading = true;

            _minDay   = minDay;
            _maxDay   = maxDay;
            _userType = userType;

            var fifteenCallsRequestModel = new FifteenCallsRequestModel();

            fifteenCallsRequestModel.FromDate = fromDate;
            fifteenCallsRequestModel.MinDay   = minDay;
            fifteenCallsRequestModel.MaxDay   = maxDay;
            FetchFifteenCallsRespnse    response   = null;
            FetchFifteenCallsABResponse ABresponse = null;

            switch (userType)
            {
            case UserTypes.Interpreter:
                InterpreterService interpreterService = new InterpreterService();
                response = await interpreterService.FetchFifteenCalls(fifteenCallsRequestModel);

                break;

            case UserTypes.Client:
                ClientService clientService = new ClientService();
                response = await clientService.FetchFifteenCalls(fifteenCallsRequestModel);

                break;

            case UserTypes.Business:
                BusinessService businessService = new BusinessService();
                if (Business != null)
                {
                    fifteenCallsRequestModel.ClientBusinessId = int.Parse(Business.ClientBusinessId);
                    ABresponse = await businessService.FetchFifteenCalls(fifteenCallsRequestModel);
                }
                break;

            case UserTypes.Agency:
                AgencyService agencyService = new AgencyService();
                if (Agency != null)
                {
                    fifteenCallsRequestModel.AgencyId = int.Parse(Agency.InterpreterBusinessId);
                    ABresponse = await agencyService.FetchFifteenCalls(fifteenCallsRequestModel);
                }
                break;
            }
            if (response != null)
            {
                foreach (var call in response.Calls)
                {
                    CallLogs.Add(call);
                }
            }


            if (ABresponse != null && ABresponse.Call != null)
            {
                foreach (var call in ABresponse.Call.Calls)
                {
                    CallLogs.Add(call);
                }
            }
            IsLoading = false;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Selects the given interpreter as the default.
 /// </summary>
 /// <remarks>
 /// This method should always be called as a using block.
 /// </remarks>
 public DefaultInterpreterSetter SelectDefaultInterpreter(PythonVersion python)
 {
     return(new DefaultInterpreterSetter(
                InterpreterService.FindInterpreter(python.Id, python.Version.ToVersion())
                ));
 }