示例#1
0
    /// <summary>
    /// Initializes the form.
    /// </summary>
    /// <param name="form">Form</param>
    /// <param name="dr">Datarow with the data</param>
    /// <param name="fi">Form info</param>
    private void InitForm(BasicForm form, DataRow dr, FormInfo fi)
    {
        form.DataRow    = dr;
        form.MacroTable = widgetInstance != null ? widgetInstance.MacroTable : new Hashtable();

        form.SubmitButton.Visible = false;
        form.SiteName             = SiteContext.CurrentSiteName;
        form.FormInformation      = fi;
        form.ShowPrivateFields    = true;
        form.OnItemValidation    += formElem_OnItemValidation;

        form.ReloadData();
    }
    /// <summary>
    /// Initializes the form.
    /// </summary>
    /// <param name="form">Form</param>
    /// <param name="dr">Datarow with the data</param>
    /// <param name="fi">Form info</param>
    private void InitForm(BasicForm form, DataRow dr, FormInfo fi)
    {
        form.DataRow    = dr;
        form.MacroTable = (mWidgetInstance != null) ? mWidgetInstance.MacroTable : new Hashtable(StringComparer.InvariantCultureIgnoreCase);

        form.SubmitButton.Visible = false;
        form.SiteName             = SiteContext.CurrentSiteName;
        form.FormInformation      = fi;
        form.OnItemValidation    += formElem_OnItemValidation;
        form.Mode = IsNewWidget ? FormModeEnum.Insert : FormModeEnum.Update;

        form.ReloadData();
    }
示例#3
0
    /// <summary>
    /// Loads basicform with filter controls.
    /// </summary>
    /// <param name="bf">BasicForm control</param>
    /// <param name="fi">Form definition</param>
    /// <param name="activityType">Activity type in case the rule type is activity</param>
    private void LoadForm(BasicForm bf, FormInfo fi, string activityType = null)
    {
        bf.FormInformation      = fi;
        bf.Data                 = RuleHelper.GetDataFromCondition(Rule, fi.GetDataRow().Table, ref activityType);
        bf.SubmitButton.Visible = false;
        bf.SiteName             = SiteContext.CurrentSiteName;

        if (Rule != null)
        {
            bf.Mode = FormModeEnum.Update;
        }

        bf.ReloadData();
    }
示例#4
0
    /// <summary>
    /// Loads basicform with filter controls.
    /// </summary>
    /// <param name="bf">BasicForm control</param>
    /// <param name="fi">Form definition</param>
    /// <param name="activityType">Activity type in case the rule type is activity</param>
    private void LoadForm(BasicForm bf, FormInfo fi, string activityType)
    {
        bf.FormInformation        = fi;
        bf.Data                   = RuleHelper.GetDataFromCondition((RuleInfo)rule, fi.GetDataRow().Table, ref activityType);
        bf.SubmitButton.Visible   = false;
        bf.SiteName               = CMSContext.CurrentSiteName;
        bf.FieldLabelCellCssClass = "RuleSettingsLabel";
        bf.FieldLabelCssClass     = null;

        if (rule != null)
        {
            bf.Mode = FormModeEnum.Update;
        }

        bf.ReloadData();
    }
    /// <summary>
    /// Initializes the form.
    /// </summary>
    /// <param name="basicForm">Form</param>
    /// <param name="dr">Data row with the data</param>
    /// <param name="fi">Form info</param>
    private void InitForm(BasicForm basicForm, DataRow dr, FormInfo fi)
    {
        if (basicForm != null)
        {
            basicForm.DataRow = dr;

            basicForm.MacroTable = webPartInstance != null ? webPartInstance.MacroTable : new Hashtable(StringComparer.InvariantCultureIgnoreCase);

            basicForm.SubmitButton.Visible = false;
            basicForm.SiteName             = SiteContext.CurrentSiteName;
            basicForm.FormInformation      = fi.Clone();
            basicForm.OnItemValidation    += formElem_OnItemValidation;

            ApplySavedCategoryCollapsingState(basicForm);

            basicForm.ReloadData();
        }
    }
示例#6
0
    /// <summary>
    /// Initializes the form.
    /// </summary>
    /// <param name="basicForm">Form</param>
    /// <param name="dr">Data row with the data</param>
    /// <param name="fi">Form info</param>
    private void InitForm(BasicForm basicForm, DataRow dr, FormInfo fi)
    {
        if (basicForm != null)
        {
            basicForm.DataRow = dr;
            if (webPartInstance != null)
            {
                basicForm.MacroTable = webPartInstance.MacroTable;
            }
            else
            {
                basicForm.MacroTable = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
            }

            if (!RequestHelper.IsPostBack() && (webPartInstance != null))
            {
                fi = new FormInfo(fi.GetXmlDefinition());

                // Load the collapsed/un-collapsed state of categories
                var categories = fi.GetCategoryNames();
                foreach (string category in categories)
                {
                    FormCategoryInfo fci = fi.GetFormCategory(category);
                    if (ValidationHelper.GetBoolean(fci.GetPropertyValue(FormCategoryPropertyEnum.Collapsible, basicForm.ContextResolver), false) && ValidationHelper.GetBoolean(fci.GetPropertyValue(FormCategoryPropertyEnum.CollapsedByDefault, basicForm.ContextResolver), false) && ValidationHelper.GetBoolean(webPartInstance.GetValue("cat_open_" + category), false))
                    {
                        fci.SetPropertyValue(FormCategoryPropertyEnum.CollapsedByDefault, "false");
                    }
                }
            }

            basicForm.SubmitButton.Visible = false;
            basicForm.SiteName             = SiteContext.CurrentSiteName;
            basicForm.FormInformation      = fi;
            basicForm.ShowPrivateFields    = true;
            basicForm.OnItemValidation    += formElem_OnItemValidation;
            basicForm.ReloadData();
        }
    }
示例#7
0
    /// <summary>
    /// Initializes the form.
    /// </summary>
    /// <param name="form">Form</param>
    /// <param name="dr">Data row with the data</param>
    /// <param name="fi">Form info</param>
    private void InitForm(BasicForm form, DataRow dr, FormInfo fi)
    {
        if (form != null)
        {
            form.DataRow = dr;
            if (webPartInstance != null)
            {
                form.MacroTable = webPartInstance.MacroTable;
            }
            else
            {
                form.MacroTable = new Hashtable();
            }

            if (!RequestHelper.IsPostBack() && (webPartInstance != null))
            {
                fi = new FormInfo(fi.GetXmlDefinition());

                // Load the collapsed/un-collapsed state of categories
                var categories = fi.GetCategoryNames();
                foreach (string category in categories)
                {
                    FormCategoryInfo fci = fi.GetFormCategory(category);
                    if (fci.CategoryCollapsible && fci.CategoryCollapsedByDefault && ValidationHelper.GetBoolean(webPartInstance.GetValue("cat_open_" + category), false))
                    {
                        fci.CategoryCollapsedByDefault = false;
                    }
                }
            }

            form.SubmitButton.Visible = false;
            form.SiteName             = CMSContext.CurrentSiteName;
            form.FormInformation      = fi;
            form.ShowPrivateFields    = true;
            form.OnItemValidation    += formElem_OnItemValidation;
            form.ReloadData();
        }
    }
    /// <summary>
    /// Initializes the form.
    /// </summary>
    /// <param name="basicForm">Form</param>
    /// <param name="dr">Data row with the data</param>
    /// <param name="fi">Form info</param>
    private void InitForm(BasicForm basicForm, DataRow dr, FormInfo fi)
    {
        if (basicForm != null)
        {
            basicForm.DataRow = dr;
            if (webPartInstance != null)
            {
                basicForm.MacroTable = webPartInstance.MacroTable;
            }
            else
            {
                basicForm.MacroTable = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
            }

            if (!RequestHelper.IsPostBack() && (webPartInstance != null))
            {
                fi = new FormInfo(fi.GetXmlDefinition());

                // Load the collapsed/un-collapsed state of categories
                var categories = fi.GetCategoryNames();
                foreach (string category in categories)
                {
                    FormCategoryInfo fci = fi.GetFormCategory(category);
                    if (ValidationHelper.GetBoolean(fci.GetPropertyValue(FormCategoryPropertyEnum.Collapsible, basicForm.ContextResolver), false) && ValidationHelper.GetBoolean(fci.GetPropertyValue(FormCategoryPropertyEnum.CollapsedByDefault, basicForm.ContextResolver), false) && ValidationHelper.GetBoolean(webPartInstance.GetValue("cat_open_" + category), false))
                    {
                        fci.SetPropertyValue(FormCategoryPropertyEnum.CollapsedByDefault, "false");
                    }
                }
            }

            basicForm.SubmitButton.Visible = false;
            basicForm.SiteName = SiteContext.CurrentSiteName;
            basicForm.FormInformation = fi;
            basicForm.ShowPrivateFields = true;
            basicForm.OnItemValidation += formElem_OnItemValidation;
            basicForm.ReloadData();
        }
    }
    /// <summary>
    /// Initializes the form.
    /// </summary>
    /// <param name="form">Form</param>
    /// <param name="dr">Datarow with the data</param>
    /// <param name="fi">Form info</param>
    private void InitForm(BasicForm form, DataRow dr, FormInfo fi)
    {
        form.DataRow = dr;
        form.MacroTable = widgetInstance != null ? widgetInstance.MacroTable : new Hashtable(StringComparer.InvariantCultureIgnoreCase);

        form.SubmitButton.Visible = false;
        form.SiteName = SiteContext.CurrentSiteName;
        form.FormInformation = fi;
        form.ShowPrivateFields = true;
        form.OnItemValidation += formElem_OnItemValidation;
        form.Mode = IsNewWidget ? FormModeEnum.Insert : FormModeEnum.Update;

        form.ReloadData();
    }
示例#10
0
    /// <summary>
    /// Loads basicform with filter controls.
    /// </summary>
    /// <param name="bf">BasicForm control</param>
    /// <param name="fi">Form definition</param>
    /// <param name="activityType">Activity type in case the rule type is activity</param>
    private void LoadForm(BasicForm bf, FormInfo fi, string activityType)
    {
        bf.FormInformation = fi;
        bf.Data = RuleHelper.GetDataFromCondition((RuleInfo)rule, fi.GetDataRow().Table, ref activityType);
        bf.SubmitButton.Visible = false;
        bf.SiteName = CMSContext.CurrentSiteName;
        bf.FieldLabelCellCssClass = "ContactLabel";
        bf.FieldLabelCssClass = null;

        if (rule != null)
        {
            bf.Mode = FormModeEnum.Update;
        }

        bf.ReloadData();
    }
    /// <summary>
    /// Loads basicform with filter controls.
    /// </summary>
    /// <param name="bf">BasicForm control</param>
    /// <param name="fi">Form definition</param>
    /// <param name="activityType">Activity type in case the rule type is activity</param>
    private void LoadForm(BasicForm bf, FormInfo fi, string activityType = null)
    {
        bf.FormInformation = fi;
        bf.Data = RuleHelper.GetDataFromCondition(Rule, fi.GetDataRow().Table, ref activityType);
        bf.SubmitButton.Visible = false;
        bf.SiteName = SiteContext.CurrentSiteName;

        if (Rule != null)
        {
            bf.Mode = FormModeEnum.Update;
        }

        bf.ReloadData();
    }
    /// <summary>
    /// Initializes the form.
    /// </summary>
    /// <param name="form">Form</param>
    /// <param name="dr">Data row with the data</param>
    /// <param name="fi">Form info</param>
    private void InitForm(BasicForm form, DataRow dr, FormInfo fi)
    {
        if (form != null)
        {
            form.DataRow = dr;
            if (webPartInstance != null)
            {
                form.MacroTable = webPartInstance.MacroTable;
            }
            else
            {
                form.MacroTable = new Hashtable();
            }

            if (!RequestHelper.IsPostBack() && (webPartInstance != null))
            {
                fi = new FormInfo(fi.GetXmlDefinition());

                // Load the collapsed/un-collapsed state of categories
                var categories = fi.GetCategoryNames();
                foreach (string category in categories)
                {
                    FormCategoryInfo fci = fi.GetFormCategory(category);
                    if (fci.CategoryCollapsible && fci.CategoryCollapsedByDefault && ValidationHelper.GetBoolean(webPartInstance.GetValue("cat_open_" + category), false))
                    {
                        fci.CategoryCollapsedByDefault = false;
                    }
                }
            }

            form.SubmitButton.Visible = false;
            form.SiteName = CMSContext.CurrentSiteName;
            form.FormInformation = fi;
            form.ShowPrivateFields = true;
            form.OnItemValidation += formElem_OnItemValidation;
            form.ReloadData();
        }
    }