public async Task LoadData(String minDay, String maxDay, UserTypes userType) { IsLoading = true; var callLogRequestModel = new CallReportRequestModel(); callLogRequestModel.MinDay = minDay; callLogRequestModel.MaxDay = maxDay; FetchABReportResponse response = null; switch (userType) { case UserTypes.Business: BusinessService businessService = new BusinessService(); if (Business != null) { callLogRequestModel.ClientBusinessId = int.Parse(Business.ClientBusinessId); response = await businessService.FetchBusinessReport(callLogRequestModel); } break; case UserTypes.Agency: AgencyService agencyService = new AgencyService(); if (Agency != null) { callLogRequestModel.AgencyId = int.Parse(Agency.InterpreterBusinessId); response = await agencyService.FetchAgencyReport(callLogRequestModel); } break; } var reportInfo = userType == UserTypes.Agency ? response.AgencyReport : response.BusinessReport; var fee = userType == UserTypes.Agency ? reportInfo.FeeInfos.First().FeePerMinute : reportInfo.BillInfo.First().FeePerMinute; var billOrFeeAmount = userType == UserTypes.Agency ? reportInfo.Report.TotalFee : reportInfo.Report.TotalBill; TotalCallSeconds = reportInfo.Report.TotalCall.ToString(); TotalPausedSeconds = reportInfo.Report.TotalPause.ToString(); BusinessFee = fee.ToString(); TotalBill = billOrFeeAmount.ToString(); IsLoading = false; }