Пример #1
0
 /// <summary>
 /// Gets all BizForms object types
 /// </summary>
 public static IEnumerable <string> GetFormObjectTypes()
 {
     return(DataClassInfoProvider.GetClasses()
            .WhereTrue("ClassIsForm")
            .Columns("ClassName")
            .Select(r => BizFormItemProvider.GetObjectType(r["ClassName"].ToString())));
 }
Пример #2
0
    protected void FieldEditor_OnAfterDefinitionUpdate(object sender, EventArgs e)
    {
        // Update form to log synchronization
        if (FormInfo != null)
        {
            BizFormInfoProvider.SetBizFormInfo(FormInfo);

            // State of unigrids may contain where/order by clauses no longer valid after definition update
            UniGrid.ResetStates(BizFormItemProvider.GetObjectType(FieldEditor.ClassName));
        }
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check 'ReadData' permission
        CheckPermissions("ReadData");

        // Register scripts
        ScriptHelper.RegisterDialogScript(Page);
        if (ShowSelectFieldsButton)
        {
            var url = ResolveUrl("~/CMSModules/BizForms/Tools/BizForm_Edit_Data_SelectFields.aspx") + QueryHelper.BuildQueryWithHash("formid", formId.ToString());
            ScriptHelper.RegisterClientScriptBlock(Page, typeof(string), "SelectFields", ScriptHelper.GetScript("function SelectFields() { modalDialog('" + url + "'  ,'BizFormFields', 500, 500); }"));
        }
        ScriptHelper.RegisterClientScriptBlock(Page, typeof(string), "Edit", ScriptHelper.GetScript(
                                                   "function EditRecord(formId, recordId) { " +
                                                   "  document.location.replace('" + ResolveUrl($"~/CMSModules/BizForms/Tools/{GetPageFile()}") + "?formID=' + formId + '&formRecordID=' + recordId); } "));

        // Display a warning message when a form with Web Forms development model is used on an MVC website
        if (SiteContext.CurrentSite.SiteIsContentOnly && bfi.FormDevelopmentModel == (int)FormDevelopmentModelEnum.WebForms)
        {
            ShowWarning(GetString("bizform_edit.webformformonmvc.warning"));
        }

        // Initialize unigrid
        gridData.OnExternalDataBound += gridData_OnExternalDataBound;
        gridData.OnLoadColumns       += gridData_OnLoadColumns;
        gridData.OnAction            += gridData_OnAction;

        if (bfi != null)
        {
            dci = DataClassInfoProvider.GetDataClassInfo(bfi.FormClassID);
            if (dci != null)
            {
                string className = dci.ClassName;

                // Set alternative form and data container
                gridData.ObjectType     = BizFormItemProvider.GetObjectType(className);
                gridData.FilterFormName = className + ".filter";
                gridData.FilterFormData = bfi;

                // Get primary column name
                gridData.OrderBy = primaryColumn = GetPrimaryColumn(FormInfo, bfi.FormName);
            }
        }
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check 'ReadData' permission
        CheckPermissions("ReadData");

        // Register scripts
        ScriptHelper.RegisterDialogScript(Page);
        if (mShowSelectFieldsButton)
        {
            var url = ResolveUrl("~/CMSModules/BizForms/Tools/BizForm_Edit_Data_SelectFields.aspx") + QueryHelper.BuildQueryWithHash("formid", formId.ToString());
            ScriptHelper.RegisterClientScriptBlock(Page, typeof(string), "SelectFields", ScriptHelper.GetScript("function SelectFields() { modalDialog('" + url + "'  ,'BizFormFields', 500, 500); }"));
        }
        ScriptHelper.RegisterClientScriptBlock(Page, typeof(string), "Edit", ScriptHelper.GetScript(
                                                   "function EditRecord(formId, recordId) { " +
                                                   "  document.location.replace('" + ResolveUrl("~/CMSModules/BizForms/Tools/BizForm_Edit_EditRecord.aspx") + "?formID=' + formId + '&formRecordID=' + recordId); } "));

        // Initialize unigrid
        gridData.OnExternalDataBound += gridData_OnExternalDataBound;
        gridData.OnLoadColumns       += gridData_OnLoadColumns;
        gridData.OnAction            += gridData_OnAction;

        if (bfi != null)
        {
            dci = DataClassInfoProvider.GetDataClassInfo(bfi.FormClassID);
            if (dci != null)
            {
                className = dci.ClassName;

                // Set alternative form and data container
                gridData.ObjectType     = BizFormItemProvider.GetObjectType(className);
                gridData.FilterFormName = className + "." + "filter";
                gridData.FilterFormData = bfi;

                // Get primary column name
                gridData.OrderBy = primaryColumn = GetPrimaryColumn(FormInfo, bfi.FormName);
            }
        }
    }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check 'ReadData' permission
        CheckPermissions("ReadData");

        // Get form ID from url
        formId = QueryHelper.GetInteger("formid", 0);

        // Register scripts
        ScriptHelper.RegisterDialogScript(this);
        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "SelectFields", ScriptHelper.GetScript("function SelectFields() { modalDialog('" +
                                                                                                            ResolveUrl("~/CMSModules/BizForms/Tools/BizForm_Edit_Data_SelectFields.aspx") + "?formid=" + formId + "'  ,'BizFormFields', 500, 500); }"));
        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "Edit", ScriptHelper.GetScript(
                                                   "function EditRecord(formId, recordId) { " +
                                                   "  document.location.replace('BizForm_Edit_EditRecord.aspx?formID=' + formId + '&formRecordID=' + recordId); } "
                                                   ));

        // Prepare header actions
        string[,] actions = new string[2, 6];
        // New record link
        actions[0, 0] = HeaderActions.TYPE_HYPERLINK;
        actions[0, 1] = GetString("bizform_edit_data.newrecord");
        actions[0, 2] = null;
        actions[0, 3] = ResolveUrl("BizForm_Edit_EditRecord.aspx?formid=" + formId.ToString());
        actions[0, 4] = null;
        actions[0, 5] = GetImageUrl("CMSModules/CMS_Form/newrecord.png");
        // Select fields link
        actions[1, 0] = HeaderActions.TYPE_HYPERLINK;
        actions[1, 1] = GetString("bizform_edit_data.selectdisplayedfields");
        actions[1, 2] = null;
        actions[1, 3] = "javascript:SelectFields();";
        actions[1, 4] = null;
        actions[1, 5] = GetImageUrl("CMSModules/CMS_Form/selectfields16.png");

        CurrentMaster.HeaderActions.Actions = actions;

        // Initialize unigrid
        gridData.OnExternalDataBound += gridData_OnExternalDataBound;
        gridData.OnLoadColumns       += gridData_OnLoadColumns;
        gridData.OnAction            += gridData_OnAction;

        // Get BizFormInfo object
        bfi          = BizFormInfoProvider.GetBizFormInfo(formId);
        EditedObject = bfi;

        if (bfi != null)
        {
            dci = DataClassInfoProvider.GetDataClass(bfi.FormClassID);
            if (dci != null)
            {
                className = dci.ClassName;

                // Set alternative form and data container
                gridData.ObjectType     = BizFormItemProvider.GetObjectType(className);
                gridData.FilterFormName = className + "." + "filter";
                gridData.FilterFormData = bfi;

                // Get primary column name
                gridData.OrderBy = primaryColumn = GetPrimaryColumn(FormInfo, bfi.FormName);
            }
        }
    }