当前位置: 首页>>代码示例>>C#>>正文


C# FormInfo.LoadFromDataStructure方法代码示例

本文整理汇总了C#中FormInfo.LoadFromDataStructure方法的典型用法代码示例。如果您正苦于以下问题:C# FormInfo.LoadFromDataStructure方法的具体用法?C# FormInfo.LoadFromDataStructure怎么用?C# FormInfo.LoadFromDataStructure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormInfo的用法示例。


在下文中一共展示了FormInfo.LoadFromDataStructure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateDefinition

    /// <summary>
    /// Generates default form definition.
    /// </summary>
    private void GenerateDefinition()
    {
        // Get info on the class
        var classInfo = DataClassInfoProvider.GetDataClassInfo(QueryHelper.GetInteger("classid", 0));
        if (classInfo == null)
        {
            return;
        }

        var manager = new TableManager(classInfo.ClassConnectionString);

        // Update schema and definition for existing class
        classInfo.ClassXmlSchema = manager.GetXmlSchema(classInfo.ClassTableName);

        var fi = new FormInfo();
        try
        {
            fi.LoadFromDataStructure(classInfo.ClassTableName, manager, true);
        }
        catch (Exception ex)
        {
            // Show error message if something caused unhandled exception
            LogAndShowError("ClassFields", "GenerateDefinition", ex);
            return;
        }

        classInfo.ClassFormDefinition = fi.GetXmlDefinition();
        DataClassInfoProvider.SetDataClassInfo(classInfo);

        URLHelper.Redirect(URLHelper.AddParameterToUrl(RequestContext.CurrentURL, "gen", "1"));
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:34,代码来源:Fields.aspx.cs

示例2: ProcessStep2


//.........这里部分代码省略.........
                            {
                                string owner = "";

                                // Get site related DB object owner setting when creating new wizard and global otherwise
                                switch (Mode)
                                {
                                    case NewClassWizardModeEnum.DocumentType:
                                    case NewClassWizardModeEnum.Class:
                                    case NewClassWizardModeEnum.CustomTable:
                                        owner = SqlHelper.GetDBSchema(SiteContext.CurrentSiteName);
                                        break;
                                }

                                if ((owner != "") && (owner.ToLowerCSafe() != "dbo"))
                                {
                                    tm.ChangeDBObjectOwner(tableName, owner);
                                    tableName = SqlHelper.GetSafeOwner(owner) + "." + tableName;
                                }
                            }
                            catch
                            {
                                // Suppress error
                            }

                            FormInfo fi;
                            if (fromExisting)
                            {
                                // From existing DB table
                                dci.ClassXmlSchema = tm.GetXmlSchema(tableName);

                                fi = new FormInfo();
                                try
                                {
                                    fi.LoadFromDataStructure(tableName, tm, AllowSystemFields);
                                }
                                catch (Exception ex)
                                {
                                    e.Cancel = true;

                                    // Show error message if something caused unhandled exception
                                    ShowError(ex.Message);
                                    return;
                                }
                            }
                            else
                            {
                                // Create empty form info
                                fi = CreateEmptyFormInfo();

                                dci.ClassXmlSchema = tm.GetXmlSchema(tableName);
                            }

                            dci.ClassTableName = tableName;
                            dci.ClassFormDefinition = fi.GetXmlDefinition();
                            dci.ClassIsCoupledClass = true;

                            dci.ClassInheritsFromClassID = ValidationHelper.GetInteger(selInherits.Value, 0);
                            dci.ClassIsContentOnly = chbContentOnly.Checked;

                            // Update class in DB
                            DataClassInfoProvider.SetDataClassInfo(dci);

                            UpdateInheritedClass(dci);

                            if (Mode == NewClassWizardModeEnum.CustomTable)
                            {
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:67,代码来源:NewClassWizard.ascx.cs


注:本文中的FormInfo.LoadFromDataStructure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。