本文整理汇总了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"));
}
示例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)
{