예제 #1
0
    protected void btnContinue_Click(object sender, EventArgs e)
    {
        using (var serviceProxy = GetServiceAPIProxy())
        {
            LoginResult login;

            try
            {
                login = serviceProxy.LoginPortalUserWithHash(
                    UserId, PasswordHash).ResultValue;
            }
            catch (ConciergeClientException)
            {
                QueueBannerError("Unable to reset password.");
                GoTo("~/Login.aspx");
                return;
            }
            ConciergeAPI.SetSession(login);

            serviceProxy.ResetPassword(ConciergeAPI.CurrentUser.ID, tbPassword.Text);
            ConciergeAPI.CurrentUser.MustChangePassword = false;
        }

        // allow us to bypass multiple identity check by explicitly redirecting to "/" if necessary
        if (string.IsNullOrWhiteSpace(NextUrl))
        {
            CRMLogic.CheckToSeeIfMultipleIdentitiesAreAccessible();
        }

        GoTo(!string.IsNullOrWhiteSpace(NextUrl) ? NextUrl : "/");
    }
예제 #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            return;
        }

        using (var api = GetConciegeAPIProxy())
        {
            api.ChangePassword(tbCurrentPassword.Text,
                               tbNewPassword.Text);
        }

        ConciergeAPI.CurrentUser.MustChangePassword = false;

        QueueBannerMessage("Your password has been changed successfully.");

        // allow us to bypass multiple identity check by explicitly redirecting to "/" from Profile Widget
        if (string.IsNullOrWhiteSpace(NextUrl))
        {
            CRMLogic.CheckToSeeIfMultipleIdentitiesAreAccessible();
        }

        GoTo(!string.IsNullOrWhiteSpace(NextUrl) ? NextUrl : "/");
    }
예제 #3
0
    private void setSessionAndForward(LoginResult loginResult)
    {
        ConciergeAPI.SetSession(loginResult);             // set the session
        SessionManager.Set <object>("PortalLinks", null); // force portal link reload, so non-public links now show

        CRMLogic.CheckToSeeIfMultipleIdentitiesAreAccessible();

        //If this login was initiated by a Single Sign On then check for the next URL to show the user
        if (!string.IsNullOrWhiteSpace(Request.Form["NextUrl"]))
        {
            string nextUrl = Request.Form["NextUrl"];
            if (!string.IsNullOrWhiteSpace(nextUrl) && Uri.IsWellFormedUriString(nextUrl, UriKind.RelativeOrAbsolute))
            {
                Response.Redirect(nextUrl);
            }
        }

        // is there a redirect URL?
        var redirectURL = Request.QueryString["redirectUrl"];

        if (!string.IsNullOrWhiteSpace(redirectURL))
        {
            Response.Redirect(redirectURL);
        }


        GoHome(); // go home
    }
예제 #4
0
    private void Save()
    {
        var primaryOrganizationRoles = targetObject.SafeGetValue <List <string> >("PrimaryOrganizationRoles__rtg");

        if (primaryOrganizationRoles != null)
        {
            var orgId = targetObject.SafeGetValue <string>("PrimaryOrganization");
            foreach (var primaryOrganizationRole in primaryOrganizationRoles)
            {
                CRMLogic.ErrorOutIfOrganizationContactRestrictionApplies(orgId, primaryOrganizationRole, targetObject.ID);
            }
        }

        targetObject = SaveObject(targetObject).ConvertTo <msIndividual>();

        if (targetObject.ID == CurrentEntity.ID)
        {
            ConciergeAPI.CurrentEntity = targetObject;
            ConciergeAPI.CurrentUser   = LoadObjectFromAPI <msPortalUser>(ConciergeAPI.CurrentUser.ID);
        }

        if (PortalConfiguration.Current.SendEmailWhenUserUpdatesInformation)
        {
            //Send the update confirmation email
            using (IConciergeAPIService proxy = GetConciegeAPIProxy())
                proxy.SendTransactionalEmail(EmailTemplates.CRM.UserInformationUpdate, targetObject.ID, null);
        }

        QueueBannerMessage("Your profile was updated successfully.");
    }
예제 #5
0
    protected void wizAddContact_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        switch (e.CurrentStepIndex)
        {
        case 0:
            lblAlreadyExists.Visible = false;
            targetEmailAddress       = tbEmailAddress.Text;
            MultiStepWizards.AddContact.EmailAddress = targetEmailAddress;

            string relationshipTypeId = string.IsNullOrWhiteSpace(RelationshipTypeId)
                                                ? ddlRelationshipType.SelectedValue
                                                : RelationshipTypeId;
            targetRelationshipType = LoadObjectFromAPI <msRelationshipType>(relationshipTypeId);
            MultiStepWizards.AddContact.RelationshipType = targetRelationshipType;

            targetIndividual = unbindAndSearch(targetEmailAddress);

            try
            {
                CRMLogic.ErrorOutIfOrganizationContactRestrictionApplies(
                    targetOrganization.ID,
                    targetRelationshipType.ID);
            }
            catch (Exception ex)
            {
                cvContactRestriction.ErrorMessage = ex.Message;
                cvContactRestriction.IsValid      = false;
                e.Cancel = true;
                return;
            }

            if (targetIndividual != null)
            {
                if (activeRelationshipExists(targetOrganization, targetIndividual, targetRelationshipType))
                {
                    lblAlreadyExists.Text =
                        string.Format("Email Address <b>{0}</b> was found related to <b>{1} {2}</b>, who already has an active <b>{3}</b> relationship to <b>{4}</b>.", targetEmailAddress, targetIndividual.FirstName, targetIndividual.LastName, targetRelationshipType.Name, targetOrganization.Name);
                    lblAlreadyExists.Visible = true;

                    e.Cancel = true;
                    return;
                }

                MultiStepWizards.AddContact.Individual = targetIndividual;
                wizAddContact.ActiveStepIndex          = 2;
            }

            break;

        case 1:
            targetIndividual = unbindNewIndividual();
            MultiStepWizards.AddContact.Individual     = targetIndividual;
            MultiStepWizards.AddContact.SendInvitation = chkSendInvitation.Checked;
            break;
        }
    }
예제 #6
0
    /// <summary>
    /// Initializes the page.
    /// </summary>
    /// <remarks>This method runs on the first load of the page, and does NOT
    /// run on postbacks. If you want to run a method on PostBacks, override the
    /// Page_Load event</remarks>
    protected override void InitializePage()
    {
        base.InitializePage();

        var individualMetadata = MetadataLogic.DescribeObject(msIndividual.CLASS_NAME);

        CRMLogic.InitPickList(individualMetadata.Fields.FirstOrDefault(f => f.Name == msIndividual.FIELDS.Prefix), tbPrefix);
        CRMLogic.InitPickList(individualMetadata.Fields.FirstOrDefault(f => f.Name == msIndividual.FIELDS.Suffix), tbSuffix);

        setProfileImage(img, targetObject);
        bindObjectToPage();
    }
예제 #7
0
    protected void UnbindRelationship()
    {
        // Test to ensure this change does not violate Org Contact Restrictions
        var orgId = leftSide.ClassType == msOrganization.CLASS_NAME
            ? leftSide.SafeGetValue <string>("ID")
            : rightSide.SafeGetValue <string>("ID");


        var indId = leftSide.ClassType == msIndividual.CLASS_NAME
            ? leftSide.SafeGetValue <string>("ID")
            : rightSide.SafeGetValue <string>("ID");

        CRMLogic.ErrorOutIfOrganizationContactRestrictionApplies(
            orgId,
            ddlRelationshipType.SelectedValue,
            indId);

        targetRelationship.Type        = ddlRelationshipType.SelectedValue;
        targetRelationship.StartDate   = dtpStartDate.SelectedDate;
        targetRelationship.EndDate     = dtpEndDate.SelectedDate;
        targetRelationship.Description = tbDescription.Text;
    }