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; } } }