/// <summary>
    /// Called when [form bound].
    /// </summary>
    protected override void OnFormBound()
    {
        ICampaign campaign = GetParentEntity() as ICampaign;

        if (campaign != null)
        {
            chkExternalList.Checked = false;
            if (campaign.UseExternalList.HasValue)
            {
                chkExternalList.Checked = campaign.UseExternalList.Value;
            }
            chkExternalList.Enabled = (campaign.ActualLaunchDate == null);
        }
        if (chkExternalList.Checked)
        {
            divDisplayGrid.Style.Add(HtmlTextWriterStyle.Display, "none");
            divExternal.Style.Add(HtmlTextWriterStyle.Display, "inline");
            lnkFilters.Style.Add(HtmlTextWriterStyle.Display, "none");
        }
        else
        {
            divDisplayGrid.Style.Add(HtmlTextWriterStyle.Display, "inline");
            divExternal.Style.Add(HtmlTextWriterStyle.Display, "none");
            lnkFilters.Style.Add(HtmlTextWriterStyle.Display, "inline");

            filterDiv.Style.Add(HtmlTextWriterStyle.Display, txtShowFilter.Value.Equals("true") ? "inline" : "none");
            chkDisplayOnOpen.Checked = Helpers.ShowTargetsOnOpen();

            if (_State.EntityID != EntityContext.EntityID.ToString())
            {
                ContextService.RemoveContext("AddFilterStateInfo");
                ContextService.RemoveContext("CT_SELECT_STATE");
                _State.EntityID = EntityContext.EntityID.ToString();
                _State.formOpen = false;
                AddDistinctGroupItemsToList();
                AddDistinctStageItemsToList();
                lbxPriority.SelectedIndex = _State.priorityFilter;
                lbxStatus.SelectedIndex   = _State.statusFilter;
            }

            grdTargets.EmptyTableRowText = GetLocalResourceObject("grdTargets.EmptyTableRowText").ToString();
            if (!_State.formOpen || (hfIsFormInit.Value == "False") || _State.manageViewOpen)
            {
                _State.formOpen          = true;
                hfIsFormInit.Value       = "True";
                txtSelectedTargets.Value = string.Empty;

                if (chkDisplayOnOpen.Checked)
                {
                    LoadGrid();
                }
                else
                {
                    grdTargets.EmptyTableRowText = GetLocalResourceObject("grdTargets.NoRecordsFoundText").ToString();
                    grdTargets.DataBind();
                }
            }
            else
            {
                LoadGrid();
            }
            ContextService.SetContext("AddFilterStateInfo", _State);
        }
        cmdSave.Visible       = chkExternalList.Checked;
        cmdUpdate.Visible     = !chkExternalList.Checked;
        cmdManageList.Visible = !chkExternalList.Checked;
        cmdDelete.Visible     = !chkExternalList.Checked;
    }
 /// <summary>
 /// Handles the CheckedChanged event of the chkDisplayOnOpen control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void chkDisplayOnOpen_CheckedChanged(object sender, EventArgs e)
 {
     Helpers.SetShowOnOpenOption((chkDisplayOnOpen.Checked ? "T" : "F"), "Web.ViewTargets");
 }
Example #3
0
 /// <summary>
 /// Called when the smartpart has been bound.  Derived components should override this method to run code that depends on
 /// entity context being set and it not changing.
 /// </summary>
 protected override void OnActivating()
 {
     cmdEmail.Enabled   = Helpers.CanLaunchEmailCampaign();
     hfIsFormInit.Value = "False";
     base.OnActivating();
 }