在BusinessObjects文件里面创建XAF类
在bo里面写入自定义实体
private string _name;
public string name
{
get { return _name; }
set { SetPropertyValue("姓名", ref _name, value); }
}
private bool _disable;
public bool disable
{
get { return _disable; }
set
{
SetPropertyValue("禁用", ref _disable, value);
}
}
private sex _sex;
public sex sex
{
get { return _sex; }
set { SetPropertyValue("性别", ref _sex, value); }
}
private DateTime _birthdata;
public DateTime birthdata
{
get { return _birthdata; }
set { SetPropertyValue("出生日期", ref _birthdata, value); }
}
private string _telephone;
public string telephone
{
get { return _telephone; }
set { SetPropertyValue("手机号码", ref _telephone, value); }
}
private string _address;
public string address
{
get { return _address; }
set { SetPropertyValue("地址", ref _address, value); }
}
private decimal _yearincome;
public decimal yearincome
{
get { return _yearincome; }
set { SetPropertyValue("年收入", ref _yearincome, value); }
}
[Size(SizeAttribute.Unlimited), VisibleInListView(true)]
[ImageEditor(ListViewImageEditorMode = ImageEditorMode.PictureEdit,
DetailViewImageEditorMode = ImageEditorMode.PictureEdit,
ListViewImageEditorCustomHeight = 40)]
public byte[] photo
{
get { return GetPropertyValue<byte[]>("photo"); }
set { SetPropertyValue<byte[]>("photo", value); }
}
sex根据枚举定义
在配置文件配置自己的连接字符串
然后直接调试运行开始会提示登录一般默认用户名admin
登录成功之后会显示出之前定义的字段以及控件还有数据库