本文整理汇总了C#中FormInfo.FieldExists方法的典型用法代码示例。如果您正苦于以下问题:C# FormInfo.FieldExists方法的具体用法?C# FormInfo.FieldExists怎么用?C# FormInfo.FieldExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormInfo
的用法示例。
在下文中一共展示了FormInfo.FieldExists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitCustomTable
/// <summary>
/// Initializes the custom table
/// </summary>
/// <param name="dci">DataClassInfo of the custom table</param>
/// <param name="fi">Form info</param>
private void InitCustomTable(DataClassInfo dci, FormInfo fi)
{
// Created by
if (chkItemCreatedBy.Checked && !fi.FieldExists("ItemCreatedBy"))
{
FormFieldInfo ffi = new FormFieldInfo();
// Fill FormInfo object
ffi.Name = "ItemCreatedBy";
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Created by");
ffi.DataType = FieldDataType.Integer;
ffi.SetPropertyValue(FormFieldPropertyEnum.DefaultValue, string.Empty);
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldDescription, string.Empty);
ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;
ffi.Settings["controlname"] = Enum.GetName(typeof(FormFieldControlTypeEnum), FormFieldControlTypeEnum.LabelControl).ToLowerCSafe();
ffi.PrimaryKey = false;
ffi.System = true;
ffi.Visible = false;
ffi.Size = 0;
ffi.AllowEmpty = true;
fi.AddFormItem(ffi);
}
// Created when
if (chkItemCreatedWhen.Checked && !fi.FieldExists("ItemCreatedWhen"))
{
FormFieldInfo ffi = new FormFieldInfo();
// Fill FormInfo object
ffi.Name = "ItemCreatedWhen";
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Created when");
ffi.DataType = FieldDataType.DateTime;
ffi.SetPropertyValue(FormFieldPropertyEnum.DefaultValue, string.Empty);
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldDescription, string.Empty);
ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;
ffi.Settings["controlname"] = Enum.GetName(typeof(FormFieldControlTypeEnum), FormFieldControlTypeEnum.LabelControl).ToLowerCSafe();
ffi.PrimaryKey = false;
ffi.System = true;
ffi.Visible = false;
ffi.Size = 0;
ffi.AllowEmpty = true;
fi.AddFormItem(ffi);
}
// Modified by
if (chkItemModifiedBy.Checked && !fi.FieldExists("ItemModifiedBy"))
{
FormFieldInfo ffi = new FormFieldInfo();
// Fill FormInfo object
ffi.Name = "ItemModifiedBy";
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Modified by");
ffi.DataType = FieldDataType.Integer;
ffi.SetPropertyValue(FormFieldPropertyEnum.DefaultValue, string.Empty);
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldDescription, string.Empty);
ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;
ffi.Settings["controlname"] = Enum.GetName(typeof(FormFieldControlTypeEnum), FormFieldControlTypeEnum.LabelControl).ToLowerCSafe();
ffi.PrimaryKey = false;
ffi.System = true;
ffi.Visible = false;
ffi.Size = 0;
ffi.AllowEmpty = true;
fi.AddFormItem(ffi);
}
// Modified when
if (chkItemModifiedWhen.Checked && !fi.FieldExists("ItemModifiedWhen"))
{
FormFieldInfo ffi = new FormFieldInfo();
// Fill FormInfo object
ffi.Name = "ItemModifiedWhen";
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Modified when");
ffi.DataType = FieldDataType.DateTime;
ffi.SetPropertyValue(FormFieldPropertyEnum.DefaultValue, string.Empty);
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldDescription, string.Empty);
ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;
ffi.Settings["controlname"] = Enum.GetName(typeof(FormFieldControlTypeEnum), FormFieldControlTypeEnum.LabelControl).ToLowerCSafe();
ffi.PrimaryKey = false;
ffi.System = true;
ffi.Visible = false;
ffi.Size = 0;
ffi.AllowEmpty = true;
fi.AddFormItem(ffi);
}
// Item order
if (chkItemOrder.Checked && !fi.FieldExists("ItemOrder"))
{
FormFieldInfo ffi = new FormFieldInfo();
//.........这里部分代码省略.........
示例2: InitCustomTable
/// <summary>
/// Initializes the custom table
/// </summary>
/// <param name="dci">DataClassInfo of the custom table</param>
/// <param name="fi">Form info</param>
/// <param name="tm">Table manager</param>
private void InitCustomTable(DataClassInfo dci, FormInfo fi, TableManager tm)
{
// Created by
if (chkItemCreatedBy.Checked && !fi.FieldExists("ItemCreatedBy"))
{
FormFieldInfo ffi = new FormFieldInfo();
// Fill FormInfo object
ffi.Name = "ItemCreatedBy";
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Created by");
ffi.DataType = FieldDataType.Integer;
ffi.SetPropertyValue(FormFieldPropertyEnum.DefaultValue, string.Empty);
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldDescription, string.Empty);
ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;
ffi.Settings["controlname"] = Enum.GetName(typeof(FormFieldControlTypeEnum), FormFieldControlTypeEnum.LabelControl).ToLowerCSafe();
ffi.PrimaryKey = false;
ffi.System = true;
ffi.Visible = false;
ffi.Size = 0;
ffi.AllowEmpty = true;
fi.AddFormItem(ffi);
}
// Created when
if (chkItemCreatedWhen.Checked && !fi.FieldExists("ItemCreatedWhen"))
{
FormFieldInfo ffi = new FormFieldInfo();
// Fill FormInfo object
ffi.Name = "ItemCreatedWhen";
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Created when");
ffi.DataType = FieldDataType.DateTime;
ffi.SetPropertyValue(FormFieldPropertyEnum.DefaultValue, string.Empty);
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldDescription, string.Empty);
ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;
ffi.Settings["controlname"] = Enum.GetName(typeof(FormFieldControlTypeEnum), FormFieldControlTypeEnum.LabelControl).ToLowerCSafe();
ffi.PrimaryKey = false;
ffi.System = true;
ffi.Visible = false;
ffi.Size = 0;
ffi.AllowEmpty = true;
fi.AddFormItem(ffi);
}
// Modified by
if (chkItemModifiedBy.Checked && !fi.FieldExists("ItemModifiedBy"))
{
FormFieldInfo ffi = new FormFieldInfo();
// Fill FormInfo object
ffi.Name = "ItemModifiedBy";
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Modified by");
ffi.DataType = FieldDataType.Integer;
ffi.SetPropertyValue(FormFieldPropertyEnum.DefaultValue, string.Empty);
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldDescription, string.Empty);
ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;
ffi.Settings["controlname"] = Enum.GetName(typeof(FormFieldControlTypeEnum), FormFieldControlTypeEnum.LabelControl).ToLowerCSafe();
ffi.PrimaryKey = false;
ffi.System = true;
ffi.Visible = false;
ffi.Size = 0;
ffi.AllowEmpty = true;
fi.AddFormItem(ffi);
}
// Modified when
if (chkItemModifiedWhen.Checked && !fi.FieldExists("ItemModifiedWhen"))
{
FormFieldInfo ffi = new FormFieldInfo();
// Fill FormInfo object
ffi.Name = "ItemModifiedWhen";
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Modified when");
ffi.DataType = FieldDataType.DateTime;
ffi.SetPropertyValue(FormFieldPropertyEnum.DefaultValue, string.Empty);
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldDescription, string.Empty);
ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;
ffi.Settings["controlname"] = Enum.GetName(typeof(FormFieldControlTypeEnum), FormFieldControlTypeEnum.LabelControl).ToLowerCSafe();
ffi.PrimaryKey = false;
ffi.System = true;
ffi.Visible = false;
ffi.Size = 0;
ffi.AllowEmpty = true;
fi.AddFormItem(ffi);
}
// Item order
if (chkItemOrder.Checked && !fi.FieldExists("ItemOrder"))
{
FormFieldInfo ffi = new FormFieldInfo();
//.........这里部分代码省略.........
示例3: InitClass
/// <summary>
/// Initializes class.
/// </summary>
/// <param name="dci">DataClassInfo</param>
/// <param name="fi">Form info</param>
private void InitClass(DataClassInfo dci, FormInfo fi)
{
// Get class code name
var pkName = txtPKName.Text.Trim();
var codeName = pkName.Substring(0, pkName.Length - 2);
// Guid
if (chkClassGuid.Checked && !fi.FieldExists(codeName + "Guid"))
{
fi.AddFormItem(CreateGuidField(codeName + "Guid"));
}
// Last modified
if (chkClassLastModified.Checked && !fi.FieldExists(codeName + "LastModified"))
{
FormFieldInfo ffi = new FormFieldInfo();
// Fill FormInfo object
ffi.Name = codeName + "LastModified";
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Last modified");
ffi.DataType = FieldDataType.DateTime;
ffi.SetPropertyValue(FormFieldPropertyEnum.DefaultValue, String.Empty);
ffi.SetPropertyValue(FormFieldPropertyEnum.FieldDescription, String.Empty);
ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;
ffi.Settings["controlname"] = Enum.GetName(typeof(FormFieldControlTypeEnum), FormFieldControlTypeEnum.LabelControl).ToLowerCSafe();
ffi.PrimaryKey = false;
ffi.System = true;
ffi.Visible = false;
ffi.Size = 0;
ffi.AllowEmpty = false;
fi.AddFormItem(ffi);
}
UpdateDataClass(dci, fi);
}