protected void form_OnDataBound(object sender, EventArgs e)
 {
     try
     {
         OUSearchMaint graph = (OUSearchMaint)this.ds.DataGraph;
         if (graph.Filter.Current.ContactType == null)
         {
             ((PXTextEdit)this.form.FindControl("edPosition")).Enabled = false;
             ((PXTextEdit)this.form.FindControl("edCompany")).Enabled  = false;
         }
     }
     catch
     {
     }
 }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.IsCallback)
        {
            OUSearchMaint graph = (OUSearchMaint)this.ds.DataGraph;
            if (this.Request.Form[_outlookIsIncome] == "1")
            {
                graph.Filter.Current.OutgoingEmail = this.Request.Form[_outlookEmail];
            }
            graph.Filter.Current.DisplayName         = this.Request.Form[_outlookDisplayName];
            graph.Filter.Current.NewContactFirstName = this.Request.Form[_outlookFirstName];
            graph.Filter.Current.NewContactLastName  = this.Request.Form[_outlookLastName];
            if (this.Request.Form[oums + _messageFields[0]] != null)
            {
                _messageFields.ForEach(
                    f =>
                    graph.SourceMessage.Cache.SetValue(graph.SourceMessage.Current, f,
                                                       this.Request.Form[oums + f])
                    );
            }
            graph.SourceMessage.Current.IsIncome = true;
            if (this.Request.Form[_outlookIsIncome] != "1")
            {
                graph.SourceMessage.Current.IsIncome = false;
            }

            var token = (string)this.Request.Form[_outlookAttachmentToken];
            if (!String.IsNullOrEmpty(graph.SourceMessage.Current.Token))// && graph.SourceMessage.Current.Body != null)
            {
                graph.CreateActivity.SetEnabled(true);
                graph.CreateCase.SetEnabled(true);
                graph.CreateContact.SetEnabled(true);
                graph.CreateLead.SetEnabled(true);
                graph.CreateOpportunity.SetEnabled(true);
            }
            else
            {
                graph.CreateActivity.SetEnabled(false);
                graph.CreateCase.SetEnabled(false);
                graph.CreateContact.SetEnabled(false);
                graph.CreateLead.SetEnabled(false);
                graph.CreateOpportunity.SetEnabled(false);
            }
        }
    }
Example #3
0
    protected void form_OnDataBound(object sender, EventArgs e)
    {
        try
        {
            OUSearchMaint graph = (OUSearchMaint)this.ds.DataGraph;

            if (graph.Filter.Current.ContactType == null)
            {
                ((PXTextEdit)this.form.FindControl("edPosition")).Enabled = false;
                ((PXTextEdit)this.form.FindControl("edCompany")).Enabled  = false;
            }
            if (graph.Filter.Current.Operation == OUOperation.APBillAttachments)
            {
                ((PXLabel)form.FindControl("personTitle")).Hidden      = true;
                ((PXSelector)form.FindControl("edContact")).Hidden     = true;
                ((PXButton)form.FindControl("edHelp")).Hidden          = true;
                ((PXTextEdit)this.form.FindControl("edSEmail")).Hidden = true;
            }
        }
        catch
        {
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.IsCallback)
        {
            OUSearchMaint graph = (OUSearchMaint)this.ds.DataGraph;

            if (this.Request.Form[oums + _messageFields[0]] != null)
            {
                _messageFields.ForEach(
                    f =>
                    graph.SourceMessage.Cache.SetValue(graph.SourceMessage.Current, f,
                                                       this.Request.Form[oums + f])
                    );
            }
            graph.SourceMessage.Current.IsIncome = true;
            if (this.Request.Form[_outlookIsIncome] != "1")
            {
                graph.SourceMessage.Current.IsIncome = false;
            }


            if (this.Request.Form[_outlookIsIncome] == "1")
            {
                graph.Filter.Current.OutgoingEmail = this.Request.Form[_outlookEmail];
            }
            graph.Filter.Current.DisplayName         = this.Request.Form[_outlookDisplayName];
            graph.Filter.Current.NewContactFirstName = this.Request.Form[_outlookFirstName];
            graph.Filter.Current.NewContactLastName  = this.Request.Form[_outlookLastName];

            var token = (string)this.Request.Form[_outlookAttachmentToken];
            if (!String.IsNullOrEmpty(graph.SourceMessage.Current.Token))// && graph.SourceMessage.Current.Body != null)
            {
                graph.CreateActivity.SetEnabled(true);
                graph.CreateCase.SetEnabled(true);
                graph.CreateContact.SetEnabled(true);
                graph.CreateLead.SetEnabled(true);
                graph.CreateOpportunity.SetEnabled(true);
            }
            else
            {
                graph.CreateActivity.SetEnabled(false);
                graph.CreateCase.SetEnabled(false);
                graph.CreateContact.SetEnabled(false);
                graph.CreateLead.SetEnabled(false);
                graph.CreateOpportunity.SetEnabled(false);
            }
        }
        else
        {
            var personTitle = (PXLabel)form.FindControl("personTitle");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "personTitleId", string.Format("let personTitleId = '{0}';", personTitle.ClientID), true);

            var help = (PXButton)form.FindControl("edHelp");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "helpId", string.Format("let helpId = '{0}';", help.ClientID), true);

            var label1 = (PXLabel)form.FindControl("PXLabel1");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "label1Id", string.Format("let label1Id='{0}';", label1.ClientID), true);

            var label2 = (PXLabel)form.FindControl("edFake");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "label2Id", string.Format("let label2Id='{0}';", label2.ClientID), true);

            var label3 = (PXLabel)form.FindControl("edFake2");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "label3Id", string.Format("let label3Id='{0}';", label3.ClientID), true);

            var attachmentsPanel = (PXSmartPanel)form.FindControl("edAttachmentsPanel");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "attachmentsPanelId", string.Format("let attachmentsPanelId='{0}';", attachmentsPanel.ClientID), true);

            var panelCaption = (PXLabel)form.FindControl("edPanelCaption");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "panelCaptionId", string.Format("let panelCaptionId='{0}';", panelCaption.ClientID), true);

            var redirectMessage = (PXLabel)form.FindControl("edCreateAPBillRedirectToScreenMessage");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "apBillRedirectMessageId", string.Format("let apBillRedirectMessageId='{0}';", redirectMessage.ClientID), true);
        }
    }