示例#1
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 OnFormBound()
 {
     ClientBindingMgr.RegisterDialogCancelButton(cmdCancel);
     if (_State != null)
     {
         if (!String.IsNullOrEmpty(txtSelectedTab.Value))
         {
             if (Convert.ToInt16(txtSelectedTab.Value) == 1)
             {
                 divLookupTargets.Style.Add(HtmlTextWriterStyle.Display, "none");
                 divAddFromGroup.Style.Add(HtmlTextWriterStyle.Display, "inline");
                 tabLookupTarget.CssClass = "inactiveTab tab";
                 tabAddFromGroup.CssClass = "activeTab tab";
             }
             else
             {
                 divAddFromGroup.Style.Add(HtmlTextWriterStyle.Display, "none");
                 divLookupTargets.Style.Add(HtmlTextWriterStyle.Display, "inline");
                 tabLookupTarget.CssClass = "activeTab tab";
                 tabAddFromGroup.CssClass = "inactiveTab tab";
             }
         }
         grdTargets.DataSource = _State.targetList;
     }
     grdTargets.DataBind();
     cmdAddTargets.Enabled = grdTargets.Rows.Count > 0;
 }
示例#2
0
    /// <summary>
    /// Raises the <see cref="E:PreRender"/> event.
    /// </summary>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        LoadTreeConfig();
        ClientBindingMgr.RegisterDialogCancelButton(cmdCancel);

        if (Visible)
        {
            ISalesOrder salesOrder = BindingSource.Current as ISalesOrder;

            // required to register the .js file used in this page
            if (DesignMode == false)
            {
                if (ScriptManager.GetCurrent(Page) != null)
                {
                    ScriptManager.GetCurrent(Page).RegisterScriptControl(this);
                }
            }

            if (salesOrder != null)
            {
                dtsProducts.SelectParameters.Clear();
                string salesorderId = (salesOrder.Id == null) ? string.Empty : salesOrder.Id.ToString();
                dtsProducts.SelectParameters.Add("salesorderId", salesorderId);
                grdProducts.DataBind();
            }
        }

        if (chkPackage.Checked != _State.Packages)
        {
            chkPackage_CheckedChanged(null, null);
        }
    }
示例#3
0
    /// <summary>
    /// Called when [form bound].
    /// </summary>
    protected override void OnFormBound()
    {
        if (IsLead)
        {
            lueLead.Text = String.Empty;
            rdgTargetType.SelectedIndex = 1;
        }
        else
        {
            rdgTargetType.SelectedIndex = 0;
        }
        SetTargetTypeDisplay();
        LoadCampaignStages();
        ClientBindingMgr.RegisterDialogCancelButton(cmdCancel);
        ClientBindingMgr.RegisterSaveButton(cmdOK);

        if (dtsOpens.SourceObject == null)
        {
            dtsOpens.SourceObject = BindingSource.Current;
        }
        if (dtsClicks.SourceObject == null)
        {
            dtsClicks.SourceObject = BindingSource.Current;
        }
        if (dtsUndeliverables.SourceObject == null)
        {
            dtsUndeliverables.SourceObject = BindingSource.Current;
        }

        grdProducts.DataSource = dtsProducts2;
        grdProducts.DataBind();
        dtsOpens.Bind();
        dtsClicks.Bind();
        dtsUndeliverables.Bind();
    }
示例#4
0
    protected override void OnFormBound()
    {
        base.OnFormBound();

        if (IsActivating)
        {
            Form.Reset(Controls);
            CurrDateValue.Timeless      = Activity.Timeless;
            CurrDateValue.DisplayTime   = !Activity.Timeless;
            CurrDateValue.DateTimeValue = Activity.StartDate;
            CompDateValue.Timeless      = Activity.Timeless;
            CompDateValue.DisplayTime   = !Activity.Timeless;
            CompDateValue.DateTimeValue = Activity.StartDate;
            GenerateGrid();
            Session[ACTSTARTDATEKEY] = null;
        }

        StartDateComparison = Activity.StartDate; //save the startdate before binding to see if it gets changed

        if (ClientBindingMgr != null)
        {
            ClientBindingMgr.RegisterBoundControl(CurrDateValue);
            ClientBindingMgr.RegisterBoundControl(CompDateValue);
        }

        UpdateActivity.Enabled = Form.IsSaveEnabled;
    }
示例#5
0
    protected override void OnFormBound()
    {
        base.OnFormBound();
        IHistory history = (IHistory)BindingSource.Current;

        SetScheduledByLabel(history);
        cmdDelete.OnClientClick = FormHelper.GetConfirmDeleteScript();
        ClientBindingMgr.RegisterSaveButton(cmdOK);

        bool isEditAllowed = CurrentUserId == history.UserId || CurrentUserId == "ADMIN";

        cmdDelete.Visible = isEditAllowed;
        cmdOK.Visible     = isEditAllowed;

        ApplicationPage page = (ApplicationPage)Page;

        page.TitleBar.Image = ResolveUrl(GetTitleBarImage());


        var parms = AppContext["ActivityParameters"] as System.Collections.Generic.Dictionary <string, string>;

        if ((parms != null) && parms.ContainsKey("AllowEditHistory"))
        {
            //means we dropped an email - the delete button should dissappear and cancel should delete the record...
            cmdDelete.Visible = false;
        }
    }
示例#6
0
    protected override void OnFormBound()
    {
        base.OnFormBound();
        ClientBindingMgr.RegisterSaveButton(btnSave);
        btnDelete.OnClientClick = string.Format("return confirm('{0}');", Sage.Platform.WebPortal.PortalUtil.JavaScriptEncode(GetLocalResourceObject("btnDelete.ActionConfirmationMessage").ToString()));
        _pickListView           = (IPickListView)BindingSource.Current;
        var picklistId = Page.Session["picklistId"] as string;

        Page.Session.Add("picklistId", _pickListView.Id.ToString());
        if (picklistId == _pickListView.Id.ToString() && IsPostBack)
        {
            //there are instances where the test default item does not get updated
            AssignDefaultTestItem();
            return;
        }
        LoadView();
        if (RoleSecurityService != null && !RoleSecurityService.HasAccess("Administration/PickList/Add"))
        {
            btnNew.Visible = false;
        }
        if (RoleSecurityService != null && !RoleSecurityService.HasAccess("Administration/PickList/Delete"))
        {
            btnDelete.Visible = false;
        }
        if (RoleSecurityService != null && !RoleSecurityService.HasAccess("Administration/PickList/Edit"))
        {
            btnSave.Visible = false;
        }
    }
    protected override void OnFormBound()
    {
        // TODO: Need to research and fix the cause of the double post back that attempts to fire a second
        // OnFormBound while the dialog is closing.  This null check should not be necessary.
        if (BindingSource.Current == null)
        {
            return;
        }

        base.OnFormBound();

        if (IsActivating)
        {
            if (Form != null)
            {
                Form.Reset(Controls);
                if (Form.IsInsert)
                {
                    if (Activity.RecurrenceState != RecurrenceState.rstOccurrence)
                    {
                        Activity.Type = Params.Type;
                    }
                }
                ClientBindingMgr.SetFocusTo(Description);
            }
        }

        // TODO: can we use OnRegisterClientScript instead?
        RegisterScripts();

        FillForm();
    }
    protected override void OnFormBound()
    {
        base.OnFormBound();

        if (IsActivating)
        {
            ResetForm();
            SetValuesFromEntityHistory();
            ClientBindingMgr.SetFocusTo(rbContact);
        }

        btnContinue.Enabled    = NewUnscheduledActivity.Checked;
        OpenActivities.Visible = false;

        if (CompleteScheduledActivity.Checked)
        {
            LookupControl lookup = GetBoundLookup();
            Session["entityName"] = lookup != null ? lookup.LookupEntityName : null;
            Session["entityId"]   = lookup != null?GetId(lookup.LookupResultValue) : null;

            OpenActivities.DataBind();
            OpenActivities.Visible = OpenActivities.Rows.Count > 0;
        }
        if (Account.LookupResultValue != null)
        {
            SetSeedValues();
        }
        if (LeadId.LookupResultValue == null)
        {
            Company.Text = string.Empty;
        }
    }
示例#9
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 OnFormBound()
 {
     base.OnFormBound();
     _parentEntity          = GetParentEntity() as IPersistentEntity;
     _parentEntityReference = _parentEntity as IComponentReference;
     ClientBindingMgr.RegisterDialogCancelButton(btnCancel);
 }
    protected override void OnFormBound()
    {
        base.OnFormBound();

        SetTitleBar();
        ClientBindingMgr.RegisterDialogCancelButton(cmdCancel);
        ClientBindingMgr.RegisterSaveButton(cmdOK);
    }
    /// <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 OnFormBound()
    {
        EventArgs e = EventArgs.Empty;

        ClientBindingMgr.RegisterDialogCancelButton(btnCancel);
        LoadTemplates();
        base.OnFormBound();
    }
 /// <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 OnFormBound()
 {
     base.OnFormBound();
     if (ClientBindingMgr != null)
     {   // register these with the ClientBindingMgr so they can do their thing without causing the dirty data warning message...
         ClientBindingMgr.RegisterBoundControl(lueCampaigns);
     }
     SetActionState();
 }
    protected override void OnWireEventHandlers()
    {
        base.OnWireEventHandlers();

        ClientBindingMgr.RegisterSaveButton(btnOK);
        ClientBindingMgr.RegisterDialogCancelButton(btnClose);
        btnClose.Click += DialogService.CloseEventHappened;
        btnOK.Click    += UpdateDataEvent;
    }
示例#14
0
 protected override void OnFormBound()
 {
     ClientBindingMgr.RegisterDialogCancelButton(cmdClose);
     dtsLeads.Bind();
     dtsMatchingLeads.Bind();
     dtsContacts.Bind();
     dtsAccounts.Bind();
     base.OnFormBound();
 }
 /// <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 OnFormBound()
 {
     ClientBindingMgr.RegisterDialogCancelButton(cmdCancel);
     if (_state != null)
     {
         grdTargets.DataSource = _state.targetList;
     }
     grdTargets.DataBind();
     cmdAddTargets.Enabled = grdTargets.Rows.Count > 0;
 }
    protected override void OnFormBound()
    {
        base.OnFormBound();
        this._pickListView = (IPickListView)this.BindingSource.Current;
        ClientBindingMgr.RegisterSaveButton(btnSave);

        btnDelete.OnClientClick = string.Format("return confirm('{0}');", Sage.Platform.WebPortal.PortalUtil.JavaScriptEncode(GetLocalResourceObject("btnDelete.ActionConfirmationMessage").ToString()));


        LoadView();
    }
 /// <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 OnFormBound()
 {
     base.OnFormBound();
     if (ClientBindingMgr != null)
     {   // register these with the ClientBindingMgr so they can do their thing without causing the dirty data warning message...
         ClientBindingMgr.RegisterBoundControl(dtpStartDate);
         ClientBindingMgr.RegisterBoundControl(pklDescription);
         ClientBindingMgr.RegisterBoundControl(pklCategory);
     }
     SetActionState();
 }
    /// <summary>
    /// Called when [form bound].
    /// </summary>
    protected override void OnFormBound()
    {
        if (ClientBindingMgr != null)
        {
            // register these with the ClientBindingMgr so they can do their thing without causing the dirty data warning message...
            ClientBindingMgr.RegisterBoundControl(lnkEmail);
        }
        var salesOrder = BindingSource.Current as ISalesOrder;

        if (salesOrder != null)
        {
            if (BusinessRuleHelper.IsMultiCurrencyEnabled())
            {
                lueCurrencyCode.LookupResultValue =
                    EntityFactory.GetRepository <IExchangeRate>()
                    .FindFirstByProperty("CurrencyCode", salesOrder.CurrencyCode);
            }
            lueCurrencyCode.SeedValue = GetPeriodIdForCurrentDate();
            SetDisplayValues();
            double shipping = salesOrder.Freight ?? 0;
            if (string.IsNullOrEmpty(curBaseShipping.FormattedText))
            {
                curBaseShipping.Text = Convert.ToString(shipping);
            }
            if (string.IsNullOrEmpty(curShipping.FormattedText))
            {
                curShipping.Text = Convert.ToString(shipping);
            }
            if (string.IsNullOrEmpty(curMyShipping.FormattedText))
            {
                curMyShipping.Text = Convert.ToString(shipping);
            }
            var systemInfo = ApplicationContext.Current.Services.Get <ISystemOptionsService>(true);
            if (systemInfo.ChangeSalesOrderRate)
            {
                divExchangeRateLabel.Visible = false;
                divExchangeRateText.Visible  = true;
            }
            else
            {
                divExchangeRateLabel.Visible = true;
                divExchangeRateText.Visible  = false;
                if (!string.IsNullOrEmpty(numExchangeRateValue.Text))
                {
                    lblExchangeRateValue.Text = Math.Round(Convert.ToDecimal(numExchangeRateValue.Text), 4).ToString();
                }
            }
        }
    }
示例#19
0
    protected override void OnFormBound()
    {
        base.OnFormBound();

        foreach (IUser selUser in _selUsers)
        {
            LookupPreFilter pf = new LookupPreFilter();
            pf.PropertyName = "Id";
            pf.OperatorCode = "!=";
            pf.FilterValue  = string.Format("'{0}'", selUser.Id.ToString());
            copyProfileParameter.UserLookupControl.LookupPreFilters.Add(pf);
        }

        ClientBindingMgr.RegisterDialogCancelButton(btnCancel);
        RegisterValidationScript();
    }
 /// <summary>
 /// Called when [form bound].
 /// </summary>
 ///
 protected override void OnFormBound()
 {
     base.OnFormBound();
     ClientBindingMgr.RegisterDialogCancelButton(cmdCancel);
     _campaign = (ICampaign)BindingSource.Current;
     if (DialogService.DialogParameters.Count > 0)
     {
         object filterStateObj;
         if (DialogService.DialogParameters.TryGetValue("TargetSelectedFilterState", out filterStateObj))
         {
             _filterState = filterStateObj as TargetSelectedFilterState;
             _filterState.IncludeSelectedOnly = true;
         }
     }
     LoadView();
 }
    protected override void OnFormBound()
    {
        base.OnFormBound();

        if (IsActivating)
        {
            ResetForm();
            SetValuesFromEntityHistory();
            ClientBindingMgr.SetFocusTo(rbContact);
        }

        btnContinue.Enabled = NewUnscheduledActivity.Checked;
        divResults.Visible  = false;

        if (CompleteScheduledActivity.Checked)
        {
            LookupControl lookup = GetBoundLookup();
            Session["entityName"] = lookup != null ? lookup.LookupEntityName : null;
            Session["entityId"]   = lookup != null?GetId(lookup.LookupResultValue) : null;

            OpenActivities.DataBind();
            divResults.Visible = true;
        }
        if (Account.LookupResultValue != null)
        {
            SetSeedValues();
        }
        if (LeadId.LookupResultValue == null)
        {
            Company.Text = string.Empty;
        }

        ScriptManager.RegisterClientScriptInclude(this, GetType(), "ScheduleCompleteActivity", Page.ResolveUrl("~/SmartParts/Activity/ScheduleCompleteActivity.js"));
        var script = new StringBuilder();

        if (Page.IsPostBack)
        {
            script.Append(" Sage.UI.Forms.ScheduleCompleteActivity.init(" + GetWorkSpace() + " );");
        }
        else
        {
            script.Append("require(['dojo/ready'], function(ready) { " +
                          "ready(function () { Sage.UI.Forms.ScheduleCompleteActivity.init(" + GetWorkSpace() + "); }); " +
                          "});");
        }
        ScriptManager.RegisterStartupScript(this, GetType(), "initialize_ScheduleCompleteActivity", script.ToString(), true);
    }
示例#22
0
 /// <summary>
 /// Called when [form bound].
 /// </summary>
 protected override void OnFormBound()
 {
     base.OnFormBound();
     ClientBindingMgr.RegisterDialogCancelButton(cmdCancel);
     this._parentEntity          = GetParentEntity() as Sage.Platform.Orm.Interfaces.IPersistentEntity;
     this._parentEntityReference = this._parentEntity as Sage.Platform.ComponentModel.IComponentReference;
     _stage = (ICampaignStage)this.BindingSource.Current;
     if (DialogService.DialogParameters.Count > 0)
     {
         object mode;
         if (DialogService.DialogParameters.TryGetValue("Mode", out mode))
         {
             _mode = mode.ToString();
         }
     }
     LoadView();
 }
示例#23
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 OnFormBound()
 {
     base.OnFormBound();
     if (ClientBindingMgr != null)
     {   // register these with the ClientBindingMgr so they can do their thing without causing the dirty data warning message...
         ClientBindingMgr.RegisterBoundControl(lueResponseLeadSource);
         ClientBindingMgr.RegisterBoundControl(dtpResponseDate);
         ClientBindingMgr.RegisterBoundControl(pklResponseStatus);
         ClientBindingMgr.RegisterBoundControl(pklResponseMethod);
         ClientBindingMgr.RegisterBoundControl(pklInterest);
         ClientBindingMgr.RegisterBoundControl(pklInterestLevel);
         ClientBindingMgr.RegisterBoundControl(lueCampaign);
     }
     if (Visible)
     {
         SetActionState();
     }
 }
 protected override void OnFormBound()
 {
     ClientBindingMgr.RegisterDialogCancelButton(cmdCancel);
     if ((Contact != null) & !IsClosing)
     {
         Sage.Entity.Interfaces.IContact contact = DialogService.DialogParameters["MoveContact"] as Sage.Entity.Interfaces.IContact;
         Sage.Entity.Interfaces.IAccount account = DialogService.DialogParameters["ToAccount"] as Sage.Entity.Interfaces.IAccount;
         this.lueMoveContact.LookupResultValue = contact;
         this.txtFromAccount.Text                        = contact.AccountName;
         this.lueToAccount.LookupResultValue             = account;
         this.lueCompletedItemsContact.SeedProperty      = "Account.Id";
         this.lueCompletedItemsContact.SeedValue         = contact.Account.Id.ToString();
         this.lueOpenItemsContact.SeedProperty           = "Account.Id";
         this.lueOpenItemsContact.SeedValue              = contact.Account.Id.ToString();
         this.lueCompletedItemsContact.LookupResultValue = DialogService.DialogParameters["CompletedItemsContact"];
         this.lueOpenItemsContact.LookupResultValue      = DialogService.DialogParameters["OpenItemsContact"];
     }
     base.OnFormBound();
 }
示例#25
0
 protected override void OnFormBound()
 {
     if (_loadPricingChanges)
     {
         if (DialogService.DialogParameters.ContainsKey("PriceList"))
         {
             ISalesOrder salesOrder = BindingSource.Current as ISalesOrder;
             lblHeader.Text = String.Format(GetLocalResourceObject("lblHeader.Text").ToString(),
                                            salesOrder.SalesOrderNumber, salesOrder.Account.AccountName);
             grdProducts.DataSource = (IList <ComponentView>)DialogService.DialogParameters["PriceList"];
             grdProducts.DataBind();
             if (grdProducts.DataKeys[0].Values[0] != null)
             {
                 curNewTotalPrice.Text = grdProducts.DataKeys[0].Values[0].ToString();
             }
             ClientBindingMgr.RegisterDialogCancelButton(btnCancel);
         }
     }
 }
    protected override void OnFormBound()
    {
        // TODO: Need to research and fix the cause of the double post back that attempts to fire a second
        // OnFormBound while the dialog is closing.  This null check should not be necessary.
        if (BindingSource.Current == null)
        {
            return;
        }

        base.OnFormBound();

        if (IsActivating && Form.IsInsert)
        {
            if (Activity.RecurrenceState != RecurrenceState.rstOccurrence)
            {
                Activity.Type = Params.Type;
            }
        }

        if (ClientBindingMgr != null)
        {
            ClientBindingMgr.RegisterSaveButton(OkButton);
            ClientBindingMgr.RegisterSaveButton(CompleteButton);
            ClientBindingMgr.RegisterSaveButton(DeleteButton);
        }

        if (!IsPostBack)
        {
            OkButton.Visible       = Form.IsSaveEnabled;
            CompleteButton.Visible = Form.IsCompleteEnabled && !Form.IsInsert;
            DeleteButton.Visible   = Form.IsDeleteEnabled;
            CreateUser.Text        = GetCreateUser();

            DeleteButton.OnClientClick = GetDeleteConfirm();
        }
        ApplicationPage page = (ApplicationPage)Page;

        page.TitleBar.Text  = GetTitleBarText();
        page.TitleBar.Image = ResolveUrl(GetTitleBarImage());
    }
示例#27
0
    /// <summary>
    /// Called when [form bound].
    /// </summary>
    protected override void OnFormBound()
    {
        if (ClientBindingMgr != null)
        {
            // register these with the ClientBindingMgr so they can do their thing without causing the dirty data warning message...
            ClientBindingMgr.RegisterBoundControl(lnkEmail);
        }
        ISalesOrder salesOrder = BindingSource.Current as ISalesOrder;

        if (salesOrder != null)
        {
            SetDisplayValues();
            double shipping = salesOrder.Freight ?? 0;
            if (String.IsNullOrEmpty(curBaseShipping.FormattedText))
            {
                curBaseShipping.Text = Convert.ToString(shipping);
            }
            if (String.IsNullOrEmpty(curShipping.FormattedText))
            {
                curShipping.Text = Convert.ToString(shipping);
            }
            if (String.IsNullOrEmpty(curMyShipping.FormattedText))
            {
                curMyShipping.Text = Convert.ToString(shipping);
            }
            var systemInfo = Sage.Platform.Application.ApplicationContext.Current.Services.Get <Sage.SalesLogix.Services.ISystemOptionsService>(true);
            if (systemInfo.ChangeSalesOrderRate)
            {
                divExchangeRateLabel.Visible = false;
                divExchangeRateText.Visible  = true;
            }
            else
            {
                divExchangeRateLabel.Visible = true;
                divExchangeRateText.Visible  = false;
                lblExchangeRateValue.Text    = numExchangeRateValue.Text;
            }
        }
    }
    protected override void OnFormBound()
    {
        // TODO: Need to research and fix the cause of the double post back that attempts to fire a second
        // OnFormBound while the dialog is closing.  This null check should not be necessary.
        if (BindingSource.Current == null)
        {
            return;
        }

        base.OnFormBound();

        if (IsActivating && Form.IsInsert)
        {
            if (Activity.RecurrenceState != RecurrenceState.rstOccurrence)
            {
                Activity.Type = GetActivityType(GetParam("type"));
            }
        }

        DisableMembersAndResources();
        if (ClientBindingMgr != null)
        {
            ClientBindingMgr.RegisterSaveButton(CompleteNow);
            ClientBindingMgr.RegisterSaveButton(CompleteAsScheduled);
        }

        if (!IsPostBack)
        {
            CompleteAsScheduled.Visible = Form.IsCompleteEnabled;
            CompleteNow.Visible         = Form.IsCompleteEnabled;
            CreateUser.Text             = GetCreateUser();
        }
        ApplicationPage page = (ApplicationPage)Page;

        page.TitleBar.Text  = GetTitleBarText();
        page.TitleBar.Image = ResolveUrl(GetTitleBarImage());
    }
 protected override void OnFormBound()
 {
     ClientBindingMgr.RegisterDialogCancelButton(btnClose);
 }
 protected override void OnFormBound()
 {
     base.OnFormBound();
     ClientBindingMgr.RegisterDialogCancelButton(btnCancel);
 }