protected void on_data_bound(object sender, EventArgs e)
    {
        bool            isIncoming       = GetIncoming();
        PXSelector      MailFromSelector = (PXSelector)message.FindControl("edMailFrom");
        PXTextEdit      MailFromTextEdit = (PXTextEdit)message.FindControl("edMailFromTe");
        PXMultiSelector MailToSelector   = (PXMultiSelector)message.FindControl("edMailTo");
        PXTextEdit      MailToTextEdit   = (PXTextEdit)message.FindControl("edMailToTe");
        PXMultiSelector MailCcSelector   = (PXMultiSelector)message.FindControl("edMailCc");
        PXTextEdit      MailCcTextEdit   = (PXTextEdit)message.FindControl("edMailCcTe");
        PXMultiSelector MailBccSelector  = (PXMultiSelector)message.FindControl("edMailBcc");
        PXTextEdit      MailBccTextEdit  = (PXTextEdit)message.FindControl("edMailBccTe");

        if (isIncoming)
        {
            if (MailFromSelector != null)
            {
                MailFromSelector.Hidden = true;
            }
            if (MailToSelector != null)
            {
                MailToSelector.Hidden = true;
            }
            if (MailCcSelector != null)
            {
                MailCcSelector.Hidden = true;
            }
            if (MailBccSelector != null)
            {
                MailBccSelector.Hidden = true;
            }

            if (MailFromTextEdit != null)
            {
                MailFromTextEdit.Hidden = false;
            }
            if (MailToTextEdit != null)
            {
                MailToTextEdit.Hidden = false;
            }
            if (MailCcTextEdit != null)
            {
                MailCcTextEdit.Hidden = false;
            }
            if (MailBccTextEdit != null)
            {
                MailBccTextEdit.Hidden = false;
            }
        }
        else
        {
            if (MailFromTextEdit != null)
            {
                MailFromTextEdit.Hidden = true;
            }
            if (MailToTextEdit != null)
            {
                MailToTextEdit.Hidden = true;
            }
            if (MailCcTextEdit != null)
            {
                MailCcTextEdit.Hidden = true;
            }
            if (MailBccTextEdit != null)
            {
                MailBccTextEdit.Hidden = true;
            }

            if (MailFromSelector != null)
            {
                MailFromSelector.Hidden = false;
            }
            if (MailToSelector != null)
            {
                MailToSelector.Hidden = false;
            }
            if (MailCcSelector != null)
            {
                MailCcSelector.Hidden = false;
            }
            if (MailBccSelector != null)
            {
                MailBccSelector.Hidden = false;
            }
        }
    }
Пример #2
0
    /// <summary>
    /// Create web control for specified field.
    /// </summary>
    private WebControl CreateControlForField(PXFieldSchema f)
    {
        System.Web.UI.WebControls.WebControl ctrl = null;
        switch (f.ControlType)
        {
        case PXSchemaControl.NumberEdit:
            ctrl = new PXNumberEdit();
            ((PXNumberEdit)ctrl).DataField = f.DataField;
            ((PXNumberEdit)ctrl).ValueType = f.DataType;
            ((PXNumberEdit)ctrl).AllowNull = true;
            break;

        case PXSchemaControl.TextEdit:
            ctrl = new PXTextEdit();
            ((PXTextEdit)ctrl).DataField = f.DataField;
            break;

        case PXSchemaControl.CheckBox:
            ctrl = new PXCheckBox();
            ((PXCheckBox)ctrl).DataField = f.DataField;
            break;

        case PXSchemaControl.ComboBox:
            ctrl = new PXDropDown();
            ((PXDropDown)ctrl).DataField = f.DataField;
            ((PXDropDown)ctrl).AllowNull = false;
            break;

        case PXSchemaControl.Selector:
            ctrl = new PXSelector();
            ((PXSelector)ctrl).DataSourceID = ds.ID;
            ((PXSelector)ctrl).DataField    = f.DataField;
            PXFieldState fs = ((RMReportMaint)ds.DataGraph).Report.Cache.GetStateExt(((RMReportMaint)ds.DataGraph).Report.Current, f.DataField) as PXFieldState;
            if (fs != null && !String.IsNullOrWhiteSpace(fs.DescriptionName))
            {
                ((PXSelector)ctrl).TextMode    = TextModeTypes.Search;
                ((PXSelector)ctrl).DisplayMode = ValueDisplayMode.Text;
            }
            else if (fs.ValueField != null && fs.ValueField.ToLower() == "compositekey")
            {
                ((PXSelector)ctrl).CommitChanges = true;
            }
            break;

        case PXSchemaControl.SegmentMask:
            ctrl = new PXSegmentMask();
            ((PXSegmentMask)ctrl).DataMember = f.ViewName;
            break;

        case PXSchemaControl.DateTimeEdit:
            ctrl = new PXDateTimeEdit();
            ((PXDateTimeEdit)ctrl).DataField = f.DataField;
            break;
        }

        if (ctrl != null)
        {
            ctrl.ID = f.DataField;
            ((IFieldEditor)ctrl).DataField = f.DataField;
        }
        return(ctrl);
    }
Пример #3
0
	/// <summary>
	/// Create web control for specified field.
	/// </summary>
	private WebControl CreateControlForField(PXFieldSchema f)
	{
		System.Web.UI.WebControls.WebControl ctrl = null;
		switch (f.ControlType)
		{
			case PXSchemaControl.NumberEdit:
				ctrl = new PXNumberEdit();
				((PXNumberEdit)ctrl).DataField = f.DataField;
				((PXNumberEdit)ctrl).ValueType = f.DataType;
				((PXNumberEdit)ctrl).AllowNull = true;
				break;
			case PXSchemaControl.TextEdit:
				ctrl = new PXTextEdit();
				((PXTextEdit)ctrl).DataField = f.DataField;
				break;
			case PXSchemaControl.CheckBox:
				ctrl = new PXCheckBox();
				((PXCheckBox)ctrl).DataField = f.DataField;
				break;
			case PXSchemaControl.ComboBox:
				ctrl = new PXDropDown();
				((PXDropDown)ctrl).DataField = f.DataField;
				((PXDropDown)ctrl).AllowNull = false;
				break;
			case PXSchemaControl.Selector:
				ctrl = new PXSelector();
				((PXSelector)ctrl).DataSourceID = ds.ID;
				((PXSelector)ctrl).DataField = f.DataField;
				PXFieldState fs = ((RMReportMaint)ds.DataGraph).Report.Cache.GetStateExt(((RMReportMaint)ds.DataGraph).Report.Current, f.DataField) as PXFieldState;
				if (fs != null && !String.IsNullOrWhiteSpace(fs.DescriptionName))
				{
					((PXSelector)ctrl).TextMode = TextModeTypes.Search;
					((PXSelector)ctrl).DisplayMode = ValueDisplayMode.Text;
				}
				else if (fs.ValueField != null && fs.ValueField.ToLower() == "compositekey")
				{
					((PXSelector)ctrl).CommitChanges = true;
				}
				break;
			case PXSchemaControl.SegmentMask:
				ctrl = new PXSegmentMask();
				((PXSegmentMask)ctrl).DataMember = f.ViewName;
				break;
			case PXSchemaControl.DateTimeEdit:
				ctrl = new PXDateTimeEdit();
				((PXDateTimeEdit)ctrl).DataField = f.DataField;
				break;
		}

		if (ctrl != null)
		{
			ctrl.ID = f.DataField;
			((IFieldEditor)ctrl).DataField = f.DataField;
		}
		return ctrl;
	}