コード例 #1
0
        public ServiceContactReturnValue GetServiceContact(HostSecurityToken oHostSecurityToken, Guid contactId)
        {
            ServiceContactReturnValue returnValue = null;

            if (Functions.ValidateIWSToken(oHostSecurityToken))
            {
                oContactService = new ContactService();
                returnValue     = oContactService.GetServiceContact(Functions.GetLogonIdFromToken(oHostSecurityToken), contactId);
            }
            else
            {
                returnValue         = new ServiceContactReturnValue();
                returnValue.Success = false;
                returnValue.Message = "Invalid Token";
            }
            return(returnValue);
        }
コード例 #2
0
 private void GetServiceContactDetails()
 {
     if (_memId == DataConstants.DummyGuid)
     {
         throw new Exception("Member Id not set");
     }
     else
     {
         ContactServiceClient contactService = null;
         try
         {
             contactService = new ContactServiceClient();
             ServiceContactReturnValue returnValue = contactService.GetServiceContact(_logonId, _memId);
             if (returnValue.Success)
             {
                 DisplayIndividualDetails(returnValue.ServiceContact);
                 SelectDropDownListValue(_ddlSourceCampaign, returnValue.CampaignId.ToString());
                 _chkReceivesMarketing.Checked = returnValue.IsReceivingMarketingStatus;
             }
             else
             {
                 throw new Exception(returnValue.Message);
             }
         }
         catch (Exception ex)
         {
             throw ex;
         }
         finally
         {
             if (contactService != null)
             {
                 if (contactService.State != System.ServiceModel.CommunicationState.Faulted)
                 {
                     contactService.Close();
                 }
             }
         }
     }
 }
コード例 #3
0
        public ServiceContactReturnValue GetServiceContact(Guid logonId, Guid contactId)
        {
            ServiceContactReturnValue returnValue = new ServiceContactReturnValue();

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

                try
                {
                    Functions.RestrictRekoopIntegrationUser(UserInformation.Instance.DbUid);
                    switch (UserInformation.Instance.UserType)
                    {
                        case DataConstants.UserType.Staff:
                            // Can do everything
                            break;
                        case DataConstants.UserType.Client:
                        case DataConstants.UserType.ThirdParty:
                            throw new Exception("Access denied");
                        default:
                            throw new Exception("Access denied");
                    }

                    SrvServiceContact srvServiceContact = new SrvServiceContact();
                    srvServiceContact.Id = contactId;
                    srvServiceContact.Load();

                    if (srvServiceContact.IsLoaded)
                    {
                        //General Info
                        returnValue.ServiceContact = new Person();
                        returnValue.ServiceContact.Title = srvServiceContact.Person.Title;
                        returnValue.ServiceContact.ForeName = srvServiceContact.Person.ForeName;
                        returnValue.ServiceContact.Surname = srvServiceContact.Person.Surname;
                        returnValue.ServiceContact.MaritalStatusId = srvServiceContact.Person.MaritalId;
                        returnValue.ServiceContact.PreviousName = srvServiceContact.Person.PersonPreviousName;
                        returnValue.ServiceContact.Occupation = srvServiceContact.Person.PersonOccupation;
                        returnValue.ServiceContact.Sex = srvServiceContact.Person.Sex;
                        returnValue.ServiceContact.DOB = srvServiceContact.Person.PersonDOB;
                        returnValue.ServiceContact.DOD = srvServiceContact.Person.PersonDOD;
                        returnValue.ServiceContact.PlaceOfBirth = srvServiceContact.Person.PersonPlaceOfBirth;
                        returnValue.ServiceContact.BirthName = srvServiceContact.Person.PersonBirthName;
                        returnValue.CampaignId = srvServiceContact.CampaignId;

                        //Additional Info
                        returnValue.ServiceContact.SalutationLettterFormal = srvServiceContact.Person.PersonSalletForm;
                        returnValue.ServiceContact.SalutationLettterInformal = srvServiceContact.Person.PersonSalutationlettterInformal;
                        returnValue.ServiceContact.SalutationLettterFriendly = srvServiceContact.Person.PersonSalLet;
                        returnValue.ServiceContact.SalutationEnvelope = srvServiceContact.Person.PersonSalEnv;
                        returnValue.ServiceContact.EthnicityId = srvServiceContact.Person.PersonEthnicityId;
                        returnValue.ServiceContact.IsInArmedForces = srvServiceContact.Person.PersonInArmedForces;
                        returnValue.ServiceContact.ArmedForcesNo = srvServiceContact.Person.PersonArmedForcesNo;
                        returnValue.ServiceContact.NINo = srvServiceContact.Person.PersonNINo;
                        returnValue.IsReceivingMarketingStatus = srvServiceContact.IsReceivingMarketingStatus;
                    }
                }
                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;
        }
コード例 #4
0
 public ServiceContactReturnValue GetServiceContact(HostSecurityToken oHostSecurityToken, Guid contactId)
 {
     ServiceContactReturnValue returnValue = null;
     if (Functions.ValidateIWSToken(oHostSecurityToken))
     {
         oContactService = new ContactService();
         returnValue = oContactService.GetServiceContact(Functions.GetLogonIdFromToken(oHostSecurityToken), contactId);
     }
     else
     {
         returnValue = new ServiceContactReturnValue();
         returnValue.Success = false;
         returnValue.Message = "Invalid Token";
     }
     return returnValue;
 }