幽梦紫曦

XAF创建实体属性快速开发

电脑版发表于:2020/11/4 9:51
  1. 在BusinessObjects文件里面创建XAF类

  2. 在bo里面写入自定义实体

  3. private string _name;

  4.         public string name

  5.         {

  6.             get { return _name; }

  7.             set { SetPropertyValue("姓名", ref _name, value); }

  8.         }

  9.         private bool _disable;


  10.         public bool disable

  11.         {

  12.             get { return _disable; }

  13.             set

  14.             {

  15.                 SetPropertyValue("禁用", ref _disable, value);

  16.             }

  17.         }


  18.         private sex _sex;


  19.         public sex sex

  20.         {

  21.             get { return _sex; }

  22.             set { SetPropertyValue("性别", ref _sex, value); }

  23.         }


  24.         private DateTime _birthdata;


  25.         public DateTime birthdata

  26.         {

  27.             get { return _birthdata; }

  28.             set { SetPropertyValue("出生日期", ref _birthdata, value); }

  29.         }


  30.         private string _telephone;


  31.         public string telephone

  32.         {

  33.             get { return _telephone; }

  34.             set { SetPropertyValue("手机号码", ref _telephone, value); }

  35.         }


  36.         private string _address;


  37.         public string address

  38.         {

  39.             get { return _address; }

  40.             set { SetPropertyValue("地址", ref _address, value); }

  41.         }


  42.         private decimal _yearincome;


  43.         public decimal yearincome

  44.         {

  45.             get { return _yearincome; }

  46.             set { SetPropertyValue("年收入", ref _yearincome, value); }

  47.         }


  48.         [Size(SizeAttribute.Unlimited), VisibleInListView(true)]

  49.         [ImageEditor(ListViewImageEditorMode = ImageEditorMode.PictureEdit,

  50.                     DetailViewImageEditorMode = ImageEditorMode.PictureEdit,

  51.                     ListViewImageEditorCustomHeight = 40)]

  52.         public byte[] photo

  53.         {

  54.             get { return GetPropertyValue<byte[]>("photo"); }

  55.             set { SetPropertyValue<byte[]>("photo", value); }

  56.         }

  57. sex根据枚举定义


  58. 在配置文件配置自己的连接字符串


  59. 然后直接调试运行开始会提示登录一般默认用户名admin

  60. 登录成功之后会显示出之前定义的字段以及控件还有数据库



关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢