Exemplo n.º 1
0
        /// <summary>
        /// Gets the supplimentary details for the role
        /// </summary>
        private void GetRoleExtendedInfo()
        {
            ContactServiceClient contactService = null;

            try
            {
                CollectionRequest collectionRequest     = new CollectionRequest();
                RoleExtendedInfoSearchCriteria criteria = new RoleExtendedInfoSearchCriteria();
                criteria.AssociationRoleId = Convert.ToInt32(_ddlRole.SelectedValue);

                contactService = new ContactServiceClient();
                RoleExtendedInfoReturnValue returnValue = contactService.RoleExtendedInfoSearch(_logonSettings.LogonId,
                                                                                                criteria, collectionRequest);

                if (returnValue.Success)
                {
                    //Set to false so that the info is not fetched again from the service if the user
                    //navigates back and does not change the role
                    _hdnRefreshRoleExtInfo.Value = "false";

                    if (returnValue.RoleExtendedInfo.Rows.Length > 0)
                    {
                        _grdAdditionalAssociationInfo.DataSource = returnValue.RoleExtendedInfo.Rows;
                        _grdAdditionalAssociationInfo.DataBind();
                    }
                    else
                    {
                        _grdAdditionalAssociationInfo.DataSource = null;
                        _grdAdditionalAssociationInfo.DataBind();

                        _wizardAddAssociationsForMatter.WizardSteps.Remove(_wizardStepAdditionalAssociationInfo2);
                    }
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (contactService != null)
                {
                    if (contactService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        contactService.Close();
                    }
                }
            }
        }
        /// <summary>
        /// Gets the supplimentary details for the role
        /// </summary>
        private void GetRoleExtendedInfo()
        {
            ContactServiceClient contactService = null;
            try
            {
                CollectionRequest collectionRequest = new CollectionRequest();
                RoleExtendedInfoSearchCriteria criteria = new RoleExtendedInfoSearchCriteria();
                criteria.AssociationRoleId = Convert.ToInt32(_ddlRole.SelectedValue);

                contactService = new ContactServiceClient();
                RoleExtendedInfoReturnValue returnValue = contactService.RoleExtendedInfoSearch(_logonSettings.LogonId,
                                            criteria, collectionRequest);

                if (returnValue.Success)
                {
                    //Set to false so that the info is not fetched again from the service if the user
                    //navigates back and does not change the role
                    _hdnRefreshRoleExtInfo.Value = "false";

                    if (returnValue.RoleExtendedInfo.Rows.Length > 0)
                    {
                        _grdAdditionalAssociationInfo.DataSource = returnValue.RoleExtendedInfo.Rows;
                        _grdAdditionalAssociationInfo.DataBind();
                    }
                    else
                    {
                        _grdAdditionalAssociationInfo.DataSource = null;
                        _grdAdditionalAssociationInfo.DataBind();

                        _wizardAddAssociationsForMatter.WizardSteps.Remove(_wizardStepAdditionalAssociationInfo2);
                    }
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (contactService != null)
                {
                    if (contactService.State != System.ServiceModel.CommunicationState.Faulted)
                        contactService.Close();
                }
            }
        }