Exemplo n.º 1
0
        public async Task <ExpenseReport[]> GetExpenseReportsForEmployeeByStatusAsync(int employeeId, ExpenseReportStatus status)
        {
            try
            {
                using (var client = new ExpenseServiceClient())
                {
                    return(await client.GetExpenseReportsForEmployeeByStatusAsync(employeeId, status));
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                this._viewService.ShowError("Could not connect to configured service.");
            }
            catch (Exception ex)
            {
                this._viewService.ShowError(String.Format("Error in WCF call: {0}", ex.Message));
            }

            return(new ExpenseReport[0]);
        }
        public async Task<ExpenseReport[]> GetExpenseReportsForEmployeeByStatusAsync(int employeeId, ExpenseReportStatus status)
        {
            try
            {
                using (var client = new ExpenseServiceClient())
                {
                    return await client.GetExpenseReportsForEmployeeByStatusAsync(employeeId, status);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                this._viewService.ShowError("Could not connect to configured service.");
            }
            catch (Exception ex)
            {
                this._viewService.ShowError(String.Format("Error in WCF call: {0}", ex.Message));
            }

            return new ExpenseReport[0];
        }