DT 的数据字典
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
779 B

1 year ago
using System;
using System.Data;
using System.Collections;
using Sp.DbPlugin;
namespace Sp.TemplatePlugin
{
public class FieldHelper
{
public FieldHelper()
{
}
public static string GetControlName(Field fd,bool find)
{
string ctlName = "";
string ctlPrefix = "";
if(find == true)
ctlPrefix = "F";
if(fd.NoteIsEnum == true)
ctlName = "ddl"+ctlPrefix+fd.PropertyName;
else
{
switch(fd.DataType.GroupName.ToUpper())
{
case "NUMBER":
case "STRING":
case "BLOB":
ctlName = "txt"+ctlPrefix+fd.PropertyName;
break;
case "DATETIME":
ctlName = "cb"+ctlPrefix+fd.PropertyName;
break;
}
}
if(fd.IsFK == true)
ctlName = "ddl"+ctlPrefix+fd.PropertyName;
return ctlName;
}
}
}