Ejemplo n.º 1
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;
    }
 /// <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();
 }
 /// <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();
                }
            }
        }
    }
Ejemplo n.º 5
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();
     }
 }
Ejemplo n.º 6
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;
            }
        }
    }
    /// <summary>
    /// Called when [form bound].
    /// </summary>
    protected override void OnFormBound()
    {
        LoadAttachments();
        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(cmdInsertFile);
            ClientBindingMgr.RegisterBoundControl(cmdEditAttachment);
            ClientBindingMgr.RegisterBoundControl(cmdInsertUpload);
            ClientBindingMgr.RegisterBoundControl(cmdEditUpload);
            ClientBindingMgr.RegisterBoundControl(btnDelete);
        }

        radUProgressArea.Localization["CancelButton"]    = GetLocalResourceObject("radProgress_Cancel").ToString();
        radUProgressArea.Localization["Uploaded"]        = GetLocalResourceObject("radProgress_Uploaded").ToString();
        radUProgressArea.Localization["Total"]           = GetLocalResourceObject("radProgress_Total").ToString();
        radUProgressArea.Localization["UploadedFiles"]   = GetLocalResourceObject("radProgress_UploadedFiles").ToString();
        radUProgressArea.Localization["CurrentFileName"] = GetLocalResourceObject("radProgress_CurrentFile").ToString();
        radUProgressArea.Localization["TimeElapsed"]     = GetLocalResourceObject("radProgress_ElapsedTime").ToString();
        radUProgressArea.Localization["TimeEstimated"]   = GetLocalResourceObject("radProgress_EstimatedTime").ToString();
        radUProgressArea.Localization["TransferSpeed"]   = GetLocalResourceObject("radProgress_TransferSpeed").ToString();
        radUProgressArea.Localization["TotalFiles"]      = String.Empty;

        if ((ScriptManager.GetCurrent(Page).IsInAsyncPostBack) && (!IsActivating)) //only do the following on async postbacks where this page is visible...
        {
            ScriptManager.RegisterStartupScript(Page, GetType(), "reInitAttachments", "Sage.AttachmentsTab.init();", true);
            return;
        }
        AttachmentScriptStrings jsonobj = new AttachmentScriptStrings();

        jsonobj.gridViewCtlId            = grdAttachments.ClientID;
        jsonobj.selRowIndxCtlID          = txtSelRowIndx.ClientID;
        jsonobj.confirmAttachDeleteMsg   = (!IsRecurringActivity()) ? GetLocalResourceObject("Confrim_DeleteAttachment_lz").ToString() : GetLocalResourceObject("Confrim_Activity_DeleteAttachment").ToString();
        jsonobj.ErrorNoRecordSelectedMsg = GetLocalResourceObject("Error_NoRecordSelected_lz").ToString();
        jsonobj.insertDiv               = insertDiv.ClientID;
        jsonobj.editDiv                 = editDiv.ClientID;
        jsonobj.urlDiv                  = urlDiv.ClientID;
        jsonobj.urlUploadDiv            = urlUploadDiv.ClientID;
        jsonobj.fileDiv                 = fileDiv.ClientID;
        jsonobj.fileUploadDiv           = fileUploadDiv.ClientID;
        jsonobj.txtConfirmDeleteElement = txtDeleteConfirmed.ClientID;
        jsonobj.AttachmentsHelpLink     = lnkAttachmentsHelp.ClientID;
        jsonobj.txtInsertURLID          = txtInsertURL.ClientID;
        jsonobj.txtInsertDesc           = txtInsertDesc.ClientID;
        jsonobj.Error_NoURL_Description = GetLocalResourceObject("Error_NoURL_Description").ToString();
        jsonobj.Error_NoURL_Address     = GetLocalResourceObject("Error_NoURL_Address").ToString();
        jsonobj.cmdInsertUpload         = cmdInsertUpload.ClientID;
        jsonobj.cmdEditUpload           = cmdEditUpload.ClientID;
        jsonobj.IsURLMode               = txtIsURLMode.ClientID;
        jsonobj.txtEditURLID            = txtEditURL.ClientID;
        jsonobj.txtEditDescID           = txtEditDesc.ClientID;
        jsonobj.cmdDeleteAttachmentID   = btnDelete.ClientID;

        jsonobj.gearsAddButtonID = cmdBrowseFiles.ClientID;
        jsonobj.cmdInsertFileID  = cmdInsertFile.ClientID;

        //string script = string.Concat("var slxattachmentstrings = ", JsonConvert.SerializeObject(jsonobj), ";$(document).ready(function() {Sage.AttachmentsTab.init();});");

        string script =
            string.Format(
                "var slxattachmentstrings = {0};$(document).ready(function() {{ Sage.AttachmentsTab.init({1});}});",
                JsonConvert.SerializeObject(jsonobj), (IsActivityInsert() || IsHistoryInsert()) ? "true" : "false");

        ScriptManager.RegisterStartupScript(Page, GetType(), "AttachmentStrings", script, true);
    }