/// <summary>
    /// Items changed event handler.
    /// </summary>
    protected void UniSelector_OnItemsSelected(object sender, EventArgs e)
    {
        CheckModifyPermissions();

        // Get new items from selector
        string newValues = ValidationHelper.GetString(accountSelector.Value, null);

        string[] newItems = newValues.Split(new[]
        {
            ';'
        }, StringSplitOptions.RemoveEmptyEntries);

        // Get all selected items
        foreach (string item in newItems)
        {
            // Check if relation already exists
            int itemID = ValidationHelper.GetInteger(item, 0);
            if (ContactGroupMemberInfoProvider.GetContactGroupMemberInfoByData(cgi.ContactGroupID, itemID, ContactGroupMemberTypeEnum.Account) == null)
            {
                ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(cgi.ContactGroupID, itemID, ContactGroupMemberTypeEnum.Account, MemberAddedHowEnum.Manual);
            }
        }

        gridElem.ReloadData();
        pnlUpdate.Update();
        accountSelector.Value = null;
    }
Exemple #2
0
 private void AddContactToContactGroup(ContactInfo contact, ContactGroupInfo contactGroup)
 {
     ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(new ContactGroupMemberInfo
     {
         ContactGroupMemberContactGroupID = contactGroup.ContactGroupID,
         ContactGroupMemberType           = ContactGroupMemberTypeEnum.Contact,
         ContactGroupMemberRelatedID      = contact.ContactID
     });
 }
    /// <summary>
    /// New groups selected event handler.
    /// </summary>
    private void UniSelector_OnItemsSelected(object sender, EventArgs e)
    {
        // Get new items from selector
        string newValues = ValidationHelper.GetString(selectGroup.Value, null);

        string[] newGroupIDs = newValues.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

        if (newGroupIDs != null)
        {
            ContactGroupMemberInfo cgmi;
            ContactGroupInfo       group;
            int groupID;

            // Get all selected groups
            foreach (string newGroupID in newGroupIDs)
            {
                groupID = ValidationHelper.GetInteger(newGroupID, 0);
                group   = ContactGroupInfoProvider.GetContactGroupInfo(groupID);
                if (group == null)
                {
                    // Group was most probably deleted after the uniselector
                    // window was opened.
                    continue;
                }

                if (UserCanManageGroup(group) || UserCanManageContact(editedContact))
                {
                    // Check if relation already exists
                    cgmi = ContactGroupMemberInfoProvider.GetContactGroupMemberInfoByData(groupID, editedContact.ContactID, ContactGroupMemberTypeEnum.Contact);
                    if (cgmi == null)
                    {
                        ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(groupID, editedContact.ContactID, ContactGroupMemberTypeEnum.Contact, MemberAddedHowEnum.Manual);
                    }
                    else if (!cgmi.ContactGroupMemberFromManual)
                    {
                        cgmi.ContactGroupMemberFromManual = true;
                        ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(cgmi);
                    }
                }
                else
                {
                    RedirectToAccessDenied(ModuleName.CONTACTMANAGEMENT, "ModifyContact or ModifyGroup");
                }
            }

            // Reload unigrid
            LoadContactGroups();
            contactGroups.ReloadData();
            pnlUpdate.Update();
            selectGroup.Value = null;
        }
    }
Exemple #4
0
    /// <summary>
    /// Items changed event handler.
    /// </summary>
    protected void UniSelector_OnItemsSelected(object sender, EventArgs e)
    {
        if (modifyCombined)
        {
            // Get new items from selector
            string   newValues = ValidationHelper.GetString(contactSelector.Value, null);
            string[] newItems  = newValues.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

            if (newItems != null)
            {
                ContactGroupMemberInfo cgmi;
                int itemId;

                // Get all selected items

                foreach (string item in newItems)
                {
                    // Check if relation already exists
                    itemId = ValidationHelper.GetInteger(item, 0);
                    cgmi   = ContactGroupMemberInfoProvider.GetContactGroupMemberInfoByData(cgi.ContactGroupID, itemId, ContactGroupMemberTypeEnum.Contact);
                    if (cgmi == null)
                    {
                        ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(cgi.ContactGroupID, itemId, ContactGroupMemberTypeEnum.Contact, MemberAddedHowEnum.Manual);
                    }
                    else if (!cgmi.ContactGroupMemberFromManual)
                    {
                        cgmi.ContactGroupMemberFromManual = true;
                        ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(cgmi);
                    }
                }

                gridElem.ReloadData();
                pnlUpdate.Update();
                contactSelector.Value = null;
            }
        }
        // No permissions
        else
        {
            if (siteID > 0)
            {
                CMSPage.RedirectToCMSDeskAccessDenied("CMS.ContactManagement", "ModifyContactGroups");
            }
            else
            {
                CMSPage.RedirectToCMSDeskAccessDenied("CMS.ContactManagement", "ModifyGlobalContactGroups");
            }
        }
    }
    /// <summary>
    /// Items changed event handler.
    /// </summary>
    protected void UniSelector_OnItemsSelected(object sender, EventArgs e)
    {
        // Check modify permission
        if (modifyCombined)
        {
            // Get new items from selector
            string   newValues = ValidationHelper.GetString(accountSelector.Value, null);
            string[] newItems  = newValues.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

            if (newItems != null)
            {
                int itemID;

                // Get all selected items
                foreach (string item in newItems)
                {
                    // Check if relation already exists
                    itemID = ValidationHelper.GetInteger(item, 0);
                    if (ContactGroupMemberInfoProvider.GetContactGroupMemberInfoByData(cgi.ContactGroupID, itemID, ContactGroupMemberTypeEnum.Account) == null)
                    {
                        ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(cgi.ContactGroupID, itemID, ContactGroupMemberTypeEnum.Account, MemberAddedHowEnum.Manual);
                    }
                }

                gridElem.ReloadData();
                pnlUpdate.Update();
                accountSelector.Value = null;
            }
        }
        else
        {
            if (siteID > 0)
            {
                CMSPage.RedirectToCMSDeskAccessDenied(ModuleEntry.CONTACTMANAGEMENT, "ModifyContactGroups");
            }
            else
            {
                CMSPage.RedirectToCMSDeskAccessDenied(ModuleEntry.CONTACTMANAGEMENT, "ModifyGlobalContactGroups");
            }
        }
    }
    /// <summary>
    /// Mass operation button "OK" click.
    /// </summary>
    protected void btnOk_Click(object sender, EventArgs e)
    {
        string resultMessage = string.Empty;

        // Get where condition depending on mass action selection
        string where;
        List <string> contactIds = null;

        What what = (What)ValidationHelper.GetInteger(drpWhat.SelectedValue, 0);

        switch (what)
        {
        // All items
        case What.All:
            // Get all contacts with scores based on filter condition
            var contacts = GetContactsWithScore();

            if (!DataHelper.DataSourceIsEmpty(contacts))
            {
                // Get array list with IDs
                contactIds = DataHelper.GetUniqueValues(contacts.Tables[0], "ContactID", true);
            }
            break;

        // Selected items
        case What.Selected:
            // Get selected IDs from unigrid
            contactIds = gridElem.SelectedItems;
            break;
        }

        // Prepare where condition
        if ((contactIds != null) && (contactIds.Count > 0))
        {
            where = SqlHelper.GetWhereCondition <int>("ContactID", contactIds, false);
        }
        else
        {
            where = "0=1";
        }

        Action action = (Action)ValidationHelper.GetInteger(drpAction.SelectedItem.Value, 0);

        switch (action)
        {
        // Action 'Change status'
        case Action.ChangeStatus:
            // Get selected status ID from hidden field
            int statusId = ValidationHelper.GetInteger(hdnIdentifier.Value, -1);
            // If status ID is 0, the status will be removed
            if (statusId >= 0)
            {
                ContactInfoProvider.UpdateContactStatus(statusId, where);
                resultMessage = GetString("om.contact.massaction.statuschanged");
            }
            break;

        // Action 'Add to contact group'
        case Action.AddToGroup:
            // Get contact group ID from hidden field
            int groupId = ValidationHelper.GetInteger(hdnIdentifier.Value, 0);
            if ((groupId > 0) && (contactIds != null))
            {
                // Add each selected contact to the contact group, skip contacts that are already members of the group
                foreach (string item in contactIds)
                {
                    int contactId = ValidationHelper.GetInteger(item, 0);
                    if (contactId > 0)
                    {
                        ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(groupId, contactId, ContactGroupMemberTypeEnum.Contact, MemberAddedHowEnum.Manual);
                    }
                }
                // Get contact group to show result message with its display name
                ContactGroupInfo group = ContactGroupInfoProvider.GetContactGroupInfo(groupId);
                if (group != null)
                {
                    resultMessage = String.Format(GetString("om.contact.massaction.addedtogroup"), group.ContactGroupDisplayName);
                }
            }
            break;

        default:
            return;
        }

        if (!string.IsNullOrEmpty(resultMessage))
        {
            lblInfo.Text    = resultMessage;
            lblInfo.Visible = true;
        }

        // Reload unigrid
        gridElem.ClearSelectedItems();
        gridElem.ReloadData();
        pnlUpdate.Update();
    }
Exemple #7
0
    /// <summary>
    /// Mass operation button "OK" click.
    /// </summary>
    protected void btnOk_Click(object sender, EventArgs e)
    {
        // Get where condition depending on mass action selection
        string where = null;

        What what = (What)ValidationHelper.GetInteger(drpWhat.SelectedValue, 0);

        switch (what)
        {
        // All items
        case What.All:
            where = SqlHelper.AddWhereCondition(gridElem.WhereCondition, gridElem.WhereClause);
            break;

        // Selected items
        case What.Selected:
            where = SqlHelper.GetWhereCondition <int>("AccountID", gridElem.SelectedItems, false);
            break;
        }

        Action action = (Action)ValidationHelper.GetInteger(drpAction.SelectedItem.Value, 0);

        switch (action)
        {
        // Action 'Change status'
        case Action.ChangeStatus:
        {
            // Get selected status ID from hidden field
            int statusId = ValidationHelper.GetInteger(hdnIdentifier.Value, -1);
            // If status ID is 0, the status will be removed
            if (statusId >= 0)
            {
                AccountInfoProvider.UpdateAccountStatus(statusId, where);
                ShowConfirmation(GetString("om.account.massaction.statuschanged"));
            }
        }
        break;

        // Action 'Add to contact group'
        case Action.AddToGroup:
        {
            // Get contact group ID from hidden field
            int groupId = ValidationHelper.GetInteger(hdnIdentifier.Value, 0);
            if (groupId > 0)
            {
                IEnumerable <string> accountIds = null;

                switch (what)
                {
                // All items
                case What.All:
                    // Get selected IDs based on where condition
                    DataSet accounts = AccountInfoProvider.GetAccounts().Where(where).Column("AccountID");
                    if (!DataHelper.DataSourceIsEmpty(accounts))
                    {
                        // Get array list with IDs
                        accountIds = DataHelper.GetUniqueValues(accounts.Tables[0], "AccountID", true);
                    }
                    break;

                // Selected items
                case What.Selected:
                    // Get selected IDs from UniGrid
                    accountIds = gridElem.SelectedItems;
                    break;
                }

                if (accountIds != null)
                {
                    // Add each selected account to the contact group, skip accounts that are already members of the group
                    foreach (string item in accountIds)
                    {
                        int accountId = ValidationHelper.GetInteger(item, 0);
                        if ((accountId > 0) && (ContactGroupMemberInfoProvider.GetContactGroupMemberInfoByData(groupId, accountId, ContactGroupMemberTypeEnum.Account) == null))
                        {
                            ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(groupId, accountId, ContactGroupMemberTypeEnum.Account, MemberAddedHowEnum.Account);
                        }
                    }
                    // Get contact group to show result message with its display name
                    ContactGroupInfo group = ContactGroupInfoProvider.GetContactGroupInfo(groupId);
                    if (group != null)
                    {
                        ShowConfirmation(String.Format(GetString("om.account.massaction.addedtogroup"), ResHelper.LocalizeString(group.ContactGroupDisplayName)));
                    }
                }
            }
        }
        break;


        // Merge click
        case Action.Merge:
            DataSet selectedAccounts = AccountHelper.GetAccounListInfos(null, where, null, -1, null);
            if (!DataHelper.DataSourceIsEmpty(selectedAccounts))
            {
                // Get selected account ID from hidden field
                int accountID = ValidationHelper.GetInteger(hdnIdentifier.Value, -1);
                // If account ID is 0 then new contact must be created
                if (accountID == 0)
                {
                    int siteID;
                    if (filter.DisplaySiteSelector || filter.DisplayGlobalOrSiteSelector)
                    {
                        siteID = filter.SelectedSiteID;
                    }
                    else
                    {
                        siteID = SiteID;
                    }

                    SetDialogParameters(selectedAccounts, AccountHelper.GetNewAccount(AccountHelper.MERGED, siteID));
                }
                // Selected contact to be merged into
                else if (accountID > 0)
                {
                    SetDialogParameters(selectedAccounts, AccountInfoProvider.GetAccountInfo(accountID));
                }
                OpenWindow();
            }
            break;

        default:
            return;
        }

        // Reload UniGrid
        gridElem.ResetSelection();
        gridElem.ReloadData();
        pnlUpdate.Update();
    }
Exemple #8
0
    /// <summary>
    /// Mass operation button "OK" click.
    /// </summary>
    protected void btnOk_Click(object sender, EventArgs e)
    {
        // Get where condition depending on mass action selection
        string where = null;

        What what = (What)ValidationHelper.GetInteger(drpWhat.SelectedValue, 0);

        switch (what)
        {
        // All items
        case What.All:
            where = SqlHelper.AddWhereCondition(gridElem.WhereCondition, gridElem.WhereClause);
            break;

        // Selected items
        case What.Selected:
            where = SqlHelper.GetWhereCondition <int>("ContactID", gridElem.SelectedItems, false);
            break;
        }

        Action action = (Action)ValidationHelper.GetInteger(drpAction.SelectedItem.Value, 0);

        switch (action)
        {
        // Action 'Change status'
        case Action.ChangeStatus:
            // Get selected status ID from hidden field
            int statusId = ValidationHelper.GetInteger(hdnIdentifier.Value, -1);
            // If status ID is 0, the status will be removed
            if (statusId >= 0)
            {
                ContactInfoProvider.UpdateContactStatus(statusId, where);
                ShowConfirmation(GetString("om.contact.massaction.statuschanged"));
            }
            break;

        // Action 'Add to contact group'
        case Action.AddToGroup:
            // Get contact group ID from hidden field
            int groupId = ValidationHelper.GetInteger(hdnIdentifier.Value, 0);
            if (groupId > 0)
            {
                var contactGroup = ContactGroupInfoProvider.GetContactGroupInfo(groupId);

                if (contactGroup == null)
                {
                    RedirectToAccessDenied(GetString("general.invalidparameters"));
                    return;
                }

                IEnumerable <string> contactIds = null;

                switch (what)
                {
                // All items
                case What.All:
                    // Get selected IDs based on where condition
                    DataSet contacts = ContactInfoProvider.GetContacts().Where(where).Column("ContactID");
                    if (!DataHelper.DataSourceIsEmpty(contacts))
                    {
                        // Get array list with IDs
                        contactIds = DataHelper.GetUniqueValues(contacts.Tables[0], "ContactID", true);
                    }
                    break;

                // Selected items
                case What.Selected:
                    // Get selected IDs from unigrid
                    contactIds = gridElem.SelectedItems;
                    break;
                }

                if (contactIds != null)
                {
                    // Add each selected contact to the contact group, skip contacts that are already members of the group
                    foreach (string item in contactIds)
                    {
                        int contactId = item.ToInteger(0);

                        if (contactId > 0)
                        {
                            ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(groupId, contactId, ContactGroupMemberTypeEnum.Contact, MemberAddedHowEnum.Manual);
                        }
                    }
                    // Show result message with contact group's display name
                    ShowConfirmation(string.Format(GetString("om.contact.massaction.addedtogroup"), HTMLHelper.HTMLEncode(ResHelper.LocalizeString(contactGroup.ContactGroupDisplayName))));
                }
            }
            break;

        default:
            return;
        }

        // Reload unigrid
        gridElem.ResetSelection();
        gridElem.ReloadData();
        pnlUpdate.Update();
    }
Exemple #9
0
    /// <summary>
    /// Mass operation button "OK" click.
    /// </summary>
    protected void btnOk_Click(object sender, EventArgs e)
    {
        string resultMessage = string.Empty;

        // Get where condition depending on mass action selection
        string where = null;

        What what = (What)ValidationHelper.GetInteger(drpWhat.SelectedValue, 0);

        switch (what)
        {
        // All items
        case What.All:
            where = gridElem.WhereCondition;
            break;

        // Selected items
        case What.Selected:
            where = SqlHelperClass.GetWhereCondition <int>("ContactID", (string[])gridElem.SelectedItems.ToArray(typeof(string)), false);
            break;
        }

        Action action = (Action)ValidationHelper.GetInteger(drpAction.SelectedItem.Value, 0);

        switch (action)
        {
        // Action 'Change status'
        case Action.ChangeStatus:
            // Get selected status ID from hidden field
            int statusId = ValidationHelper.GetInteger(hdnIdentificator.Value, -1);
            // If status ID is 0, the status will be removed
            if (statusId >= 0)
            {
                ContactInfoProvider.UpdateContactStatus(statusId, where);
                resultMessage = GetString("om.contact.massaction.statuschanged");
            }
            break;

        // Action 'Add to contact group'
        case Action.AddToGroup:
            // Get contact group ID from hidden field
            int groupId = ValidationHelper.GetInteger(hdnIdentificator.Value, 0);
            if (groupId > 0)
            {
                ArrayList contactIds = null;
                switch (what)
                {
                // All items
                case What.All:
                    // Get selected IDs based on where condition
                    DataSet contacts = ContactInfoProvider.GetContacts(where, null, 0, "ContactID");
                    if (!DataHelper.DataSourceIsEmpty(contacts))
                    {
                        // Get array list with IDs
                        contactIds = DataHelper.GetUniqueValues(contacts.Tables[0], "ContactID", true);
                    }
                    break;

                // Selected items
                case What.Selected:
                    // Get selected IDs from unigrid
                    contactIds = gridElem.SelectedItems;
                    break;
                }

                if (contactIds != null)
                {
                    int contactId = 0;
                    // Add each selected contact to the contact group, skip contacts that are already members of the group
                    foreach (string item in contactIds)
                    {
                        contactId = ValidationHelper.GetInteger(item, 0);
                        if (contactId > 0)
                        {
                            ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(groupId, contactId, ContactGroupMemberTypeEnum.Contact, MemberAddedHowEnum.Manual);
                        }
                    }
                    // Get contact group to show result message with its display name
                    ContactGroupInfo group = ContactGroupInfoProvider.GetContactGroupInfo(groupId);
                    if (group != null)
                    {
                        resultMessage = String.Format(GetString("om.contact.massaction.addedtogroup"), group.ContactGroupDisplayName);
                    }
                }
            }
            break;

        // Merge click
        case Action.Merge:
            DataSet selectedContacts = ContactHelper.GetContactListInfos(null, where, null, -1, null);
            if (!DataHelper.DataSourceIsEmpty(selectedContacts))
            {
                // Get selected contact ID from hidden field
                int contactID = ValidationHelper.GetInteger(hdnIdentificator.Value, -1);
                // If contact ID is 0 then new contact must be created
                if (contactID == 0)
                {
                    int siteID;
                    if (filter.DisplaySiteSelector || filter.DisplayGlobalOrSiteSelector)
                    {
                        siteID = filter.SelectedSiteID;
                    }
                    else
                    {
                        siteID = SiteID;
                    }

                    SetDialogParameters(selectedContacts, ContactHelper.GetNewContact(ContactHelper.MERGED, true, siteID));
                }
                // Selected contact to be merged into
                else if (contactID > 0)
                {
                    SetDialogParameters(selectedContacts, ContactInfoProvider.GetContactInfo(contactID));
                }
                OpenWindow();
            }

            break;

        default:
            return;
        }

        if (!string.IsNullOrEmpty(resultMessage))
        {
            lblInfo.Text    = resultMessage;
            lblInfo.Visible = true;
        }

        // Reload unigrid
        gridElem.ClearSelectedItems();
        gridElem.ReloadData();
        pnlUpdate.Update();
    }
    /// <summary>
    /// Mass operation button "OK" click.
    /// </summary>
    protected void btnOk_Click(object sender, EventArgs e)
    {
        // Get where condition depending on mass action selection
        string where = null;

        What what = (What)ValidationHelper.GetInteger(drpWhat.SelectedValue, 0);

        switch (what)
        {
        // All items
        case What.All:
            where = SqlHelper.AddWhereCondition(gridElem.WhereCondition, gridElem.WhereClause);
            break;

        // Selected items
        case What.Selected:
            where = SqlHelper.GetWhereCondition <int>("ContactID", gridElem.SelectedItems, false);
            break;
        }

        Action action = (Action)ValidationHelper.GetInteger(drpAction.SelectedItem.Value, 0);

        switch (action)
        {
        // Action 'Change status'
        case Action.ChangeStatus:
            // Get selected status ID from hidden field
            int statusId = ValidationHelper.GetInteger(hdnIdentifier.Value, -1);
            // If status ID is 0, the status will be removed
            if (statusId >= 0)
            {
                ContactInfoProvider.UpdateContactStatus(statusId, where);
                ShowConfirmation(GetString("om.contact.massaction.statuschanged"));
            }
            break;

        // Action 'Add to contact group'
        case Action.AddToGroup:
            // Get contact group ID from hidden field
            int groupId = ValidationHelper.GetInteger(hdnIdentifier.Value, 0);
            if (groupId > 0)
            {
                var contactGroup = ContactGroupInfoProvider.GetContactGroupInfo(groupId);

                if (contactGroup == null)
                {
                    RedirectToAccessDenied(GetString("general.invalidparameters"));
                    return;
                }

                if (contactGroup.ContactGroupSiteID != CurrentSite.SiteID)
                {
                    RedirectToAccessDenied(GetString("general.invalidparameters"));
                    return;
                }

                List <string> contactIds = null;
                switch (what)
                {
                // All items
                case What.All:
                    // Get selected IDs based on where condition
                    DataSet contacts = ContactInfoProvider.GetContacts().Where(where).Column("ContactID");
                    if (!DataHelper.DataSourceIsEmpty(contacts))
                    {
                        // Get array list with IDs
                        contactIds = DataHelper.GetUniqueValues(contacts.Tables[0], "ContactID", true);
                    }
                    break;

                // Selected items
                case What.Selected:
                    // Get selected IDs from unigrid
                    contactIds = gridElem.SelectedItems;
                    break;
                }

                if (contactIds != null)
                {
                    // Add each selected contact to the contact group, skip contacts that are already members of the group
                    foreach (string item in contactIds)
                    {
                        int contactId = item.ToInteger(0);

                        if (contactId > 0)
                        {
                            ContactGroupMemberInfoProvider.SetContactGroupMemberInfo(groupId, contactId, ContactGroupMemberTypeEnum.Contact, MemberAddedHowEnum.Manual);
                        }
                    }
                    // Show result message with contact group's display name
                    ShowConfirmation(String.Format(GetString("om.contact.massaction.addedtogroup"), ResHelper.LocalizeString(contactGroup.ContactGroupDisplayName)));
                }
            }
            break;

        // Merge click
        case Action.Merge:
            DataSet selectedContacts = ContactHelper.GetContactListInfos(null, where, null, -1, null);
            if (!DataHelper.DataSourceIsEmpty(selectedContacts))
            {
                // Get selected contact ID from hidden field
                int contactID = ValidationHelper.GetInteger(hdnIdentifier.Value, -1);
                // If contact ID is 0 then new contact must be created
                if (contactID == 0)
                {
                    int siteID;
                    if (filter.DisplaySiteSelector || filter.DisplayGlobalOrSiteSelector)
                    {
                        siteID = filter.SelectedSiteID;
                    }
                    else
                    {
                        siteID = SiteID;
                    }

                    SetDialogParameters(selectedContacts, ContactHelper.GetNewContact(ContactHelper.MERGED, true, siteID));
                }
                // Selected contact to be merged into
                else if (contactID > 0)
                {
                    SetDialogParameters(selectedContacts, ContactInfoProvider.GetContactInfo(contactID));
                }
                OpenWindow();
            }

            break;

        default:
            return;
        }

        // Reload unigrid
        gridElem.ClearSelectedItems();
        gridElem.ReloadData();
        pnlUpdate.Update();
    }