/// <summary>
        /// Set the values for additional details
        /// </summary>
        /// <returns></returns>
        public AdditionalAddressElement[] GetAdditionalDetails()
        {
            AdditionalAddressElement[] addressDetails = new AdditionalAddressElement[10];

            #region Set Second Person's Additional Address Information
            for (int i = 0; i <= 9; i++)
            {
                addressDetails[i] = new AdditionalAddressElement();
                switch (i)
                {
                case 0:
                    addressDetails[0].ElementText = _txtHomeTelephone.Text;
                    break;

                case 1:
                    addressDetails[1].ElementText = _txtWorkTel1.Text;
                    break;

                case 2:
                    addressDetails[2].ElementText = _txtWorkTel2.Text;
                    break;

                case 3:
                    addressDetails[3].ElementText = _txtDDI.Text;
                    break;

                case 4:
                    addressDetails[4].ElementText = _txtMob1.Text;
                    break;

                case 5:
                    addressDetails[5].ElementText = _txtMob2.Text;
                    break;

                case 6:
                    addressDetails[6].ElementText = _txtFax.Text;
                    break;

                case 7:
                    addressDetails[7].ElementText = _txtHomeEmail.Text;
                    break;

                case 8:
                    addressDetails[8].ElementText = _txtWorkEmail.Text;
                    break;

                case 9:
                    addressDetails[9].ElementText = _txtURL.Text;
                    break;
                }
            }
            #endregion

            return(addressDetails);
        }
Example #2
0
        /// <summary>
        /// Saves the additional address element.
        /// </summary>
        /// <param name="oHostSecurityToken">HostSecurityToken obtained when security provider of IWS is called</param>
        /// <param name="additionalElement">The additional element.</param>
        /// <returns></returns>
        public ReturnValue SaveAdditionalAddressElement(HostSecurityToken oHostSecurityToken,
                                                        AdditionalAddressElement additionalElement)
        {
            ReturnValue returnValue = null;

            if (Functions.ValidateIWSToken(oHostSecurityToken))
            {
                oContactService = new ContactService();
                returnValue     = oContactService.SaveAdditionalAddressElement(Functions.GetLogonIdFromToken(oHostSecurityToken), additionalElement);
            }
            else
            {
                returnValue         = new ReturnValue();
                returnValue.Success = false;
                returnValue.Message = "Invalid Token";
            }
            return(returnValue);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="isSecondClient"></param>
        /// <returns></returns>
        public ConflictCheckStandardReturnValue PerformConflictCheck()
        {
            ConflictCheckStandardReturnValue dsConflictCheckFields;
            ClientServiceClient clientService = new ClientServiceClient();

            IRIS.Law.WebServiceInterfaces.Contact.AdditionalAddressElement[] addressElementsFirst;
            addressElementsFirst = null;

            if (_additionalAddressDetails != null && _additionalAddressDetails.Length == 10)
            {
                //if (!_isSecondClient || _isSecondClient)
                //{
                addressElementsFirst = new AdditionalAddressElement[10];
                #region Set First Person's and Second Person's Additional Address Information
                for (int i = 0; i <= 9; i++)
                {
                    addressElementsFirst[i] = new AdditionalAddressElement();
                    switch (i)
                    {
                    case 0:
                        addressElementsFirst[0].ElementText = _additionalAddressDetails[0].ElementText;
                        break;

                    case 1:
                        addressElementsFirst[1].ElementText = _additionalAddressDetails[1].ElementText;
                        break;

                    case 2:
                        addressElementsFirst[2].ElementText = _additionalAddressDetails[2].ElementText;
                        break;

                    case 3:
                        addressElementsFirst[3].ElementText = _additionalAddressDetails[3].ElementText;
                        break;

                    case 4:
                        addressElementsFirst[4].ElementText = _additionalAddressDetails[4].ElementText;
                        break;

                    case 5:
                        addressElementsFirst[5].ElementText = _additionalAddressDetails[5].ElementText;
                        break;

                    case 6:
                        addressElementsFirst[6].ElementText = _additionalAddressDetails[6].ElementText;
                        break;

                    case 7:
                        addressElementsFirst[7].ElementText = _additionalAddressDetails[7].ElementText;
                        break;

                    case 8:
                        addressElementsFirst[8].ElementText = _additionalAddressDetails[8].ElementText;
                        break;

                    case 9:
                        addressElementsFirst[9].ElementText = _additionalAddressDetails[9].ElementText;
                        break;
                    }
                    //}
                    #endregion
                }
            }

            CollectionRequest collectionRequest = new CollectionRequest();
            collectionRequest.StartRow = 0;
            dsConflictCheckFields      = clientService.ConflictCheck(_logonSettings.LogonId,
                                                                     collectionRequest,
                                                                     _clientType,
                                                                     _person,
                                                                     _organisation,
                                                                     _address,
                                                                     addressElementsFirst,
                                                                     _logonSettings.ConflictCheckRoles
                                                                     );

            return(dsConflictCheckFields);
        }
Example #4
0
        protected void _grdContactDetails_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            ContactServiceClient contactService = null;

            try
            {
                TextBox txtElementText = (TextBox)_grdContactDetails.Rows[e.RowIndex].FindControl("_txtElementText");
                contactService = new ContactServiceClient();
                AdditionalAddressElement element = new AdditionalAddressElement();

                Guid _memberId       = DataConstants.DummyGuid;
                Guid _organisationId = DataConstants.DummyGuid;

                if (Session[SessionName.MemberId] != null && Session[SessionName.OrganisationId] != null)
                {
                    _memberId       = (Guid)Session[SessionName.MemberId];
                    _organisationId = (Guid)Session[SessionName.OrganisationId];
                }

                if (_logonSettings.UserType == (int)DataConstants.UserType.ThirdParty && Request.QueryString["mydetails"] == "true")
                {
                    _memberId       = _logonSettings.MemberId;
                    _organisationId = _logonSettings.OrganisationId;
                }

                element.MemberId       = _memberId;
                element.OrganisationId = _organisationId;
                element.TypeId         = (int)_grdContactDetails.DataKeys[e.RowIndex].Values["TypeId"];
                element.ElementText    = txtElementText.Text.Trim();
                element.ElementComment = ((TextBox)_grdContactDetails.Rows[e.RowIndex].FindControl("_txtElementComment")).Text.Trim();
                element.AddressId      = (int)_grdContactDetails.DataKeys[e.RowIndex].Values["AddressId"];

                ReturnValue returnValue = contactService.SaveAdditionalAddressElement(((LogonReturnValue)Session[SessionName.LogonSettings]).LogonId, element);
                if (returnValue.Success)
                {
                    //update the modified additional info in the session
                    AdditionalAddressElement[] additionalAddressElements = (AdditionalAddressElement[])Session[SessionName.ContactDetails];
                    for (int i = 0; i < additionalAddressElements.Length; i++)
                    {
                        if (additionalAddressElements[i].TypeId == element.TypeId)
                        {
                            additionalAddressElements[i].ElementText    = element.ElementText;
                            additionalAddressElements[i].ElementComment = element.ElementComment;
                            break;
                        }
                    }

                    _messageCssClass = "successMessage";
                    _message         = "Edit successful";
                }
                else
                {
                    _messageCssClass = "errorMessage";
                    _message         = returnValue.Message;
                }

                _grdContactDetails.EditIndex = -1;
                DisplayContactDetails();
            }
            catch (Exception ex)
            {
                _messageCssClass = "errorMessage";
                _message         = ex.Message;
            }
            finally
            {
                if (contactService != null)
                {
                    if (contactService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        contactService.Close();
                    }
                }

                if (ErrorOccured != null)
                {
                    OnErrorOccured(System.EventArgs.Empty);
                }
            }
        }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="logonId"></param>
        /// <param name="collectionRequest"></param>
        /// <param name="criteria"></param>
        /// <returns></returns>
        public PartnerSearchReturnValue PartnerSearch(Guid logonId, CollectionRequest collectionRequest,
                                                      PartnerSearchCriteria criteria)
        {
            PartnerSearchReturnValue returnValue = new PartnerSearchReturnValue();

            try
            {
                // Get the logged on user from the current logons and add their
                // ApplicationSettings the list of concurrent sessions.
                Host.LoadLoggedOnUser(logonId);

                try
                {
                    switch (UserInformation.Instance.UserType)
                    {
                    case DataConstants.UserType.Staff:
                    case DataConstants.UserType.Client:
                    case DataConstants.UserType.ThirdParty:
                        // Can do everything
                        break;

                    default:
                        throw new Exception("Access denied");
                    }

                    // Create a data list creator for a list of matters
                    DataListCreator <PartnerSearchItem> dataListCreator = new DataListCreator <PartnerSearchItem>();

                    // Declare an inline event (annonymous delegate) to read the
                    // dataset if it is required
                    dataListCreator.ReadDataSet += delegate(object Sender, ReadDataSetEventArgs e)
                    {
                        // TODO: Does not use criteria: Name
                        e.DataSet = SrvEarnerLookup.GetPartnerLookup(criteria.IncludeArchived);

                        DataTable dt = Functions.SortDataTable(e.DataSet.Tables[0], "PersonSurname");
                        e.DataSet.Tables.Remove(e.DataSet.Tables[0]);
                        e.DataSet.Tables.Add(dt);
                    };

                    // Create the data list
                    DataList <PartnerSearchItem> partnerList = dataListCreator.Create(logonId,
                                                                                      // Give the query a name so it can be cached
                                                                                      "PartnerSearch",
                                                                                      // Tell it the query criteria used so if the cache is accessed
                                                                                      // again it knows if it is the same query
                                                                                      criteria.ToString(),
                                                                                      collectionRequest,
                                                                                      // Import mappings to map the dataset row fields to the data
                                                                                      // list entity properties
                                                                                      new ImportMapping[] {
                        new ImportMapping("PartnerId", "MemberId"),
                        new ImportMapping("Name", "PersonName"),
                        new ImportMapping("PersonTitle", "PersonTitle"),
                        new ImportMapping("Surname", "PersonSurname")
                    }
                                                                                      );

                    DataSet dsPartnerList;

                    partnerList.Rows.ForEach(delegate(PartnerSearchItem item)
                    {
                        dsPartnerList = SrvAddressLookup.GetMemberAddresses(item.PartnerId);
                        SrvAddress srvAddress;
                        int intCtr;

                        foreach (DataRow dr in dsPartnerList.Tables[0].Rows)
                        {
                            srvAddress          = new SrvAddress();
                            srvAddress.MemberId = item.PartnerId;
                            srvAddress.Load(int.Parse(dr["addressId"].ToString()));

                            for (intCtr = 0; intCtr < srvAddress.AdditionalInfoElements.Count; intCtr++)
                            {
                                AdditionalAddressElement additionalAddressElement = new AdditionalAddressElement();

                                if (srvAddress.AdditionalInfoElements[intCtr].AddressElTypeId == 8)
                                {
                                    item.Email = srvAddress.AdditionalInfoElements[intCtr].AddressElementText;
                                }
                            }
                        }
                    });


                    returnValue.Partners = partnerList;
                }
                finally
                {
                    // Remove the logged on user's ApplicationSettings from the
                    // list of concurrent sessions
                    Host.UnloadLoggedOnUser();
                }
            }
            catch (System.Data.SqlClient.SqlException)
            {
                returnValue.Success = false;
                returnValue.Message = Functions.SQLErrorMessage;
            }
            catch (Exception Ex)
            {
                returnValue.Success = false;
                returnValue.Message = Ex.Message;
            }

            return(returnValue);
        }