private void LoadMatterFeeEarner(Guid ProjectID) { MatterServiceClient matterService = new MatterServiceClient(); try { MatterReturnValue matterReturnValue = new MatterReturnValue(); matterReturnValue = matterService.GetMatter(_logonSettings.LogonId, ProjectID); if (matterReturnValue.Success) { if (matterReturnValue != null) { if (matterReturnValue.Matter.FeeEarnerMemberId != null) { EarnerServiceClient partnerClient = new EarnerServiceClient(); try { PartnerSearchCriteria partnerCriteria = new PartnerSearchCriteria(); CollectionRequest collectionRequest = new CollectionRequest(); collectionRequest.StartRow = 0; PartnerSearchReturnValue partnerReturnValue = partnerClient.PartnerSearch(_logonSettings.LogonId, collectionRequest, partnerCriteria); if (partnerReturnValue.Success) { if (partnerReturnValue.Partners != null) { for (int i = 0; i < partnerReturnValue.Partners.Rows.Length; i++) { if (partnerReturnValue.Partners.Rows[i].PartnerId.ToString() == matterReturnValue.Matter.FeeEarnerMemberId.ToString()) { _txtAttendees.Text = CommonFunctions.MakeFullName(partnerReturnValue.Partners.Rows[i].PersonTitle, partnerReturnValue.Partners.Rows[i].Name, partnerReturnValue.Partners.Rows[i].Surname); _hdnAttendeesMemberId.Value = partnerReturnValue.Partners.Rows[i].PartnerId.ToString() + ";"; } } } } else { _lblError.Text = partnerReturnValue.Message; } } catch (Exception ex) { throw ex; } finally { if (partnerClient.State != System.ServiceModel.CommunicationState.Faulted) partnerClient.Close(); } } } } } catch (Exception ex) { throw ex; } finally { if (matterService.State != System.ServiceModel.CommunicationState.Faulted) matterService.Close(); } }
/// <summary> /// Loads client matter details on load controls in edit mode /// </summary> /// <param name="projectId"></param> private void LoadClientMatterDetails(Guid projectId) { MatterServiceClient matterService = null; MatterReturnValue matterReturnValue = null; try { matterService = new MatterServiceClient(); try { matterReturnValue = new MatterReturnValue(); matterReturnValue = matterService.GetMatter(((LogonReturnValue)Session[SessionName.LogonSettings]).LogonId, projectId); if (matterReturnValue.Success) { if (matterReturnValue != null) { #region Load Client Details // Stores ClientID if (matterReturnValue.ClientDetails.IsMember) { Session[SessionName.MemberId] = matterReturnValue.ClientDetails.MemberId; Session[SessionName.OrganisationId] = DataConstants.DummyGuid; } else { Session[SessionName.MemberId] = DataConstants.DummyGuid; // Shouldn't be looking for MemberId for Organisation Client // Session[SessionName.OrganisationId] = matterReturnValue.ClientDetails.MemberId; Session[SessionName.OrganisationId] = matterReturnValue.ClientDetails.OrganisationId; } _cliMatDetails.IsClientMember = matterReturnValue.ClientDetails.IsMember; Session[SessionName.ClientRef] = matterReturnValue.ClientDetails.Reference; Session[SessionName.ClientName] = matterReturnValue.ClientDetails.FullName; if (_cliMatDetails.Message != null) { if (_cliMatDetails.Message.Trim().Length > 0) { throw new Exception("Loading failed for Client Matter Details.<br>Exception occured is: " + _cliMatDetails.Message); } } #endregion } else { throw new Exception("Load failed."); } } else { throw new Exception(matterReturnValue.Message); } } catch (System.ServiceModel.EndpointNotFoundException) { _lblMessage.Text = DataConstants.WSEndPointErrorMessage; _lblMessage.CssClass = "errorMessage"; } catch (Exception ex) { _lblMessage.CssClass = "errorMessage"; _lblMessage.Text = ex.Message; } finally { if (matterService.State != System.ServiceModel.CommunicationState.Faulted) matterService.Close(); } } catch (System.ServiceModel.EndpointNotFoundException) { _lblMessage.Text = DataConstants.WSEndPointErrorMessage; _lblMessage.CssClass = "errorMessage"; } catch (Exception ex) { _lblMessage.CssClass = "errorMessage"; _lblMessage.Text = ex.Message; } }
private void LoadClientMatterDetails(Guid projectId) { try { MatterServiceClient matterService = new MatterServiceClient(); try { MatterReturnValue matterReturnValue = new MatterReturnValue(); matterReturnValue = matterService.GetMatter(((LogonReturnValue)Session[SessionName.LogonSettings]).LogonId, projectId); if (matterReturnValue.Success) { if (matterReturnValue != null) { #region Load Client Details // Store ClientID if (matterReturnValue.ClientDetails.IsMember) { _cliMatDetails.MemberId = matterReturnValue.ClientDetails.MemberId; _cliMatDetails.OrganisationId = DataConstants.DummyGuid; } else { _cliMatDetails.MemberId = DataConstants.DummyGuid; _cliMatDetails.OrganisationId = matterReturnValue.ClientDetails.MemberId; } _cliMatDetails.IsClientMember = matterReturnValue.ClientDetails.IsMember; _cliMatDetails.ClientRef = matterReturnValue.ClientDetails.Reference; _cliMatDetails.ClientName = matterReturnValue.ClientDetails.FullName; if (_cliMatDetails.Message != null) { if (_cliMatDetails.Message.Trim().Length > 0) { throw new Exception("Loading failed for Client Matter Details.<br>Exception occured is: " + _cliMatDetails.Message); } } #endregion } else { throw new Exception("Load failed."); } } else { throw new Exception(matterReturnValue.Message); } } catch (Exception ex) { throw ex; } finally { if (matterService.State != System.ServiceModel.CommunicationState.Faulted) matterService.Close(); } } catch (Exception ex) { throw ex; } }
/// <summary> /// Loads the client matter details. /// </summary> private void LoadClientMatterDetails() { if (_projectId != DataConstants.DummyGuid) { Guid memberId; Guid organisationId; try { MatterServiceClient matterService = new MatterServiceClient(); try { MatterReturnValue matterReturnValue = new MatterReturnValue(); matterReturnValue = matterService.GetMatter(_logonId, _projectId); if (matterReturnValue.Success) { #region Load Client Details if (matterReturnValue.ClientDetails.IsMember) { memberId = matterReturnValue.ClientDetails.MemberId; organisationId = DataConstants.DummyGuid; } else { memberId = DataConstants.DummyGuid; organisationId = matterReturnValue.ClientDetails.MemberId; } ListItem item = new ListItem(); item.Text = matterReturnValue.ClientDetails.FullName; item.Value = memberId.ToString() + "$" + organisationId.ToString(); _ddlClients.Items.Add(item); //Get the matters for the client GetClientMatters(memberId, organisationId); //Select the matter if (_ddlClientMatters.Items.Count > 0) { ListItem matter = _ddlClientMatters.Items.FindByValue(_projectId.ToString()); if (matter != null) { _ddlClientMatters.SelectedValue = matter.Value; OnMatterChanged(EventArgs.Empty); } } else { throw new Exception("Error loading matter"); } #endregion } else { throw new Exception(matterReturnValue.Message); } } catch (Exception ex) { throw ex; } finally { if (matterService.State != System.ServiceModel.CommunicationState.Faulted) matterService.Close(); } } catch (Exception ex) { throw ex; } } }
/// <summary> /// Loads the client matter details. /// </summary> private void LoadClientMatterDetails() { if (_projectId != DataConstants.DummyGuid) { Guid memberId; Guid organisationId; try { MatterServiceClient matterService = new MatterServiceClient(); try { MatterReturnValue matterReturnValue = new MatterReturnValue(); matterReturnValue = matterService.GetMatter(_logonId, _projectId); if (matterReturnValue.Success) { #region Load Client Details if (matterReturnValue.ClientDetails.IsMember) { memberId = matterReturnValue.ClientDetails.MemberId; organisationId = DataConstants.DummyGuid; } else { memberId = DataConstants.DummyGuid; organisationId = matterReturnValue.ClientDetails.MemberId; } ListItem item = new ListItem(); item.Text = matterReturnValue.ClientDetails.FullName; item.Value = memberId.ToString() + "$" + organisationId.ToString(); _ddlClients.Items.Add(item); //Get the matters for the client GetClientMatters(memberId, organisationId); //Select the matter if (_ddlClientMatters.Items.Count > 0) { ListItem matter = _ddlClientMatters.Items.FindByValue(_projectId.ToString()); if (matter != null) { _ddlClientMatters.SelectedValue = matter.Value; OnMatterChanged(EventArgs.Empty); } } else { throw new Exception("Error loading matter"); } #endregion } else { throw new Exception(matterReturnValue.Message); } } catch (Exception ex) { throw ex; } finally { if (matterService.State != System.ServiceModel.CommunicationState.Faulted) { matterService.Close(); } } } catch (Exception ex) { throw ex; } } }
/// <summary> /// Loads client matter details on load controls in edit mode /// </summary> /// <param name="projectId"></param> private void LoadClientMatterDetails(Guid projectId) { MatterServiceClient matterService = null; MatterReturnValue matterReturnValue = null; try { matterService = new MatterServiceClient(); try { matterReturnValue = new MatterReturnValue(); matterReturnValue = matterService.GetMatter(((LogonReturnValue)Session[SessionName.LogonSettings]).LogonId, projectId); if (matterReturnValue.Success) { if (matterReturnValue != null) { #region Load Client Details // Stores ClientID if (matterReturnValue.ClientDetails.IsMember) { Session[SessionName.MemberId] = matterReturnValue.ClientDetails.MemberId; Session[SessionName.OrganisationId] = DataConstants.DummyGuid; } else { Session[SessionName.MemberId] = DataConstants.DummyGuid; // Shouldn't be looking for MemberId for Organisation Client // Session[SessionName.OrganisationId] = matterReturnValue.ClientDetails.MemberId; Session[SessionName.OrganisationId] = matterReturnValue.ClientDetails.OrganisationId; } _cliMatDetails.IsClientMember = matterReturnValue.ClientDetails.IsMember; Session[SessionName.ClientRef] = matterReturnValue.ClientDetails.Reference; Session[SessionName.ClientName] = matterReturnValue.ClientDetails.FullName; if (_cliMatDetails.Message != null) { if (_cliMatDetails.Message.Trim().Length > 0) { throw new Exception("Loading failed for Client Matter Details.<br>Exception occured is: " + _cliMatDetails.Message); } } #endregion } else { throw new Exception("Load failed."); } } else { throw new Exception(matterReturnValue.Message); } } catch (System.ServiceModel.EndpointNotFoundException) { _lblMessage.Text = DataConstants.WSEndPointErrorMessage; _lblMessage.CssClass = "errorMessage"; } catch (Exception ex) { _lblMessage.CssClass = "errorMessage"; _lblMessage.Text = ex.Message; } finally { if (matterService.State != System.ServiceModel.CommunicationState.Faulted) { matterService.Close(); } } } catch (System.ServiceModel.EndpointNotFoundException) { _lblMessage.Text = DataConstants.WSEndPointErrorMessage; _lblMessage.CssClass = "errorMessage"; } catch (Exception ex) { _lblMessage.CssClass = "errorMessage"; _lblMessage.Text = ex.Message; } }
private void LoadClientMatterDetails(Guid projectId) { try { MatterServiceClient matterService = new MatterServiceClient(); try { MatterReturnValue matterReturnValue = new MatterReturnValue(); matterReturnValue = matterService.GetMatter(((LogonReturnValue)Session[SessionName.LogonSettings]).LogonId, projectId); if (matterReturnValue.Success) { if (matterReturnValue != null) { #region Load Client Details // Store ClientID if (matterReturnValue.ClientDetails.IsMember) { _cliMatDetails.MemberId = matterReturnValue.ClientDetails.MemberId; _cliMatDetails.OrganisationId = DataConstants.DummyGuid; } else { _cliMatDetails.MemberId = DataConstants.DummyGuid; _cliMatDetails.OrganisationId = matterReturnValue.ClientDetails.MemberId; } _cliMatDetails.IsClientMember = matterReturnValue.ClientDetails.IsMember; _cliMatDetails.ClientRef = matterReturnValue.ClientDetails.Reference; _cliMatDetails.ClientName = matterReturnValue.ClientDetails.FullName; if (_cliMatDetails.Message != null) { if (_cliMatDetails.Message.Trim().Length > 0) { throw new Exception("Loading failed for Client Matter Details.<br>Exception occured is: " + _cliMatDetails.Message); } } #endregion } else { throw new Exception("Load failed."); } } else { throw new Exception(matterReturnValue.Message); } } catch (Exception ex) { throw ex; } finally { if (matterService.State != System.ServiceModel.CommunicationState.Faulted) { matterService.Close(); } } } catch (Exception ex) { throw ex; } }
private void LoadMatterFeeEarner(Guid ProjectID) { MatterServiceClient matterService = new MatterServiceClient(); try { MatterReturnValue matterReturnValue = new MatterReturnValue(); matterReturnValue = matterService.GetMatter(_logonSettings.LogonId, ProjectID); if (matterReturnValue.Success) { if (matterReturnValue != null) { if (matterReturnValue.Matter.FeeEarnerMemberId != null) { EarnerServiceClient partnerClient = new EarnerServiceClient(); try { PartnerSearchCriteria partnerCriteria = new PartnerSearchCriteria(); CollectionRequest collectionRequest = new CollectionRequest(); collectionRequest.StartRow = 0; PartnerSearchReturnValue partnerReturnValue = partnerClient.PartnerSearch(_logonSettings.LogonId, collectionRequest, partnerCriteria); if (partnerReturnValue.Success) { if (partnerReturnValue.Partners != null) { for (int i = 0; i < partnerReturnValue.Partners.Rows.Length; i++) { if (partnerReturnValue.Partners.Rows[i].PartnerId.ToString() == matterReturnValue.Matter.FeeEarnerMemberId.ToString()) { _txtAttendees.Text = CommonFunctions.MakeFullName(partnerReturnValue.Partners.Rows[i].PersonTitle, partnerReturnValue.Partners.Rows[i].Name, partnerReturnValue.Partners.Rows[i].Surname); _hdnAttendeesMemberId.Value = partnerReturnValue.Partners.Rows[i].PartnerId.ToString() + ";"; } } } } else { _lblError.Text = partnerReturnValue.Message; } } catch (Exception ex) { throw ex; } finally { if (partnerClient.State != System.ServiceModel.CommunicationState.Faulted) { partnerClient.Close(); } } } } } } catch (Exception ex) { throw ex; } finally { if (matterService.State != System.ServiceModel.CommunicationState.Faulted) { matterService.Close(); } } }