/// <summary> /// Loads client balances details by project id /// </summary> /// <param name="startRow">starting row for grid view</param> /// <param name="pageSize">Sets the page size for grid view.</param> /// <param name="forceRefresh">Gets records if forcefresh is true else gets records from cacahe.</param> /// <returns>Retrieves client balances details by project id</returns> public BalancesSearchItem[] LoadClientBalancesDetails(int startRow, int pageSize, bool forceRefresh) { AccountsServiceClient accountsService = null; BalancesSearchItem[] clientBalances = null; try { if (Session[SessionName.ProjectId] != null) { accountsService = new AccountsServiceClient(); CollectionRequest collectionRequest = new CollectionRequest(); collectionRequest.ForceRefresh = forceRefresh; collectionRequest.StartRow = startRow; collectionRequest.RowCount = pageSize; Guid projectId = (Guid)Session[SessionName.ProjectId]; Guid logonId = ((LogonReturnValue)HttpContext.Current.Session[SessionName.LogonSettings]).LogonId; BalancesSearchReturnValue returnValue = accountsService.GetClientBalancesDetails(logonId, collectionRequest, projectId); if (returnValue.Success) { _clientRowCount = returnValue.Balances.TotalRowCount; clientBalances = returnValue.Balances.Rows; } else { _lblMessage.CssClass = "errorMessage"; _lblMessage.Text = returnValue.Message; } } } catch (Exception ex) { throw ex; } finally { if (accountsService != null) { if (accountsService.State != System.ServiceModel.CommunicationState.Faulted) { accountsService.Close(); } } } return(clientBalances); }
/// <summary> /// Loads client balances details by project id /// </summary> /// <param name="startRow">starting row for grid view</param> /// <param name="pageSize">Sets the page size for grid view.</param> /// <param name="forceRefresh">Gets records if forcefresh is true else gets records from cacahe.</param> /// <returns>Retrieves client balances details by project id</returns> public BalancesSearchItem[] LoadClientBalancesDetails(int startRow, int pageSize, bool forceRefresh) { AccountsServiceClient accountsService = null; BalancesSearchItem[] clientBalances = null; try { if (Session[SessionName.ProjectId] != null) { accountsService = new AccountsServiceClient(); CollectionRequest collectionRequest = new CollectionRequest(); collectionRequest.ForceRefresh = forceRefresh; collectionRequest.StartRow = startRow; collectionRequest.RowCount = pageSize; Guid projectId = (Guid)Session[SessionName.ProjectId]; Guid logonId = ((LogonReturnValue)HttpContext.Current.Session[SessionName.LogonSettings]).LogonId; BalancesSearchReturnValue returnValue = accountsService.GetClientBalancesDetails(logonId, collectionRequest, projectId); if (returnValue.Success) { _clientRowCount = returnValue.Balances.TotalRowCount; clientBalances = returnValue.Balances.Rows; } else { _lblMessage.CssClass = "errorMessage"; _lblMessage.Text = returnValue.Message; } } } catch (Exception ex) { throw ex; } finally { if (accountsService != null) { if (accountsService.State != System.ServiceModel.CommunicationState.Faulted) accountsService.Close(); } } return clientBalances; }