当前位置:网站首页>DEV XPO对比之XAF BO
DEV XPO对比之XAF BO
2022-07-01 05:51:00 【qq_16215957】
using DevExpress.Data.Filtering;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.DC;
using DevExpress.ExpressApp.Model;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.BaseImpl.PermissionPolicy;
using DevExpress.Persistent.Validation;
using DevExpress.Xpo;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace XYZ.Module.BusinessObjects
{
[DefaultClassOptions]
//[ImageName("BO_Contact")]
//[DefaultProperty("DisplayMemberNameForLookupEditorsOfThisType")]
//[DefaultListViewOptions(MasterDetailMode.ListViewOnly, false, NewItemRowPosition.None)]
//[Persistent("DatabaseTableName")]
// Specify more UI options using a declarative approach (https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument112701).
[ModelDefault("AllowEdit", "True")]
[ModelDefault("AllowDelete", "True")]
[ModelDefault("DefaultListViewAllowEdit", "False")]
[ModelDefault("DefaultListViewMasterDetailMode", "ListViewOnly")]
[ModelDefault("DefaultListViewNewItemRowPosition", "Top")]
[ModelDefault("DefaultListViewShowAutoFilterRow", "True")]
[ModelDefault("DefaultListViewShowFindPanel", "True")]
[ModelDefault("DefaultLookupEditorMode", "AllItems")]
[ModelDefault("IsCloneable", "True")]
public class XYZ_Producer : BaseObject
{ // Inherit from a different class to provide a custom primary key, concurrency and deletion behavior, etc. (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument113146.aspx).
// Use CodeRush to create XPO classes and properties with a few keystrokes.
// https://docs.devexpress.com/CodeRushForRoslyn/118557
public XYZ_Producer(Session session)
: base(session)
{
}
PermissionPolicyUser GetCurrentUser()
{
PermissionPolicyUser user = null;
try
{
//return Session.GetObjectByKey<PermissionPolicyUser>(SecuritySystem.CurrentUserId); // In XAF apps for versions older than v20.1.7.
user = Session.FindObject<PermissionPolicyUser>(CriteriaOperator.Parse("Oid=CurrentUserId()"));
}
catch (Exception ex)
{
}
return user; // In non-XAF apps where SecuritySystem.Instance is unavailable (v20.1.7+).
}
public override void AfterConstruction()
{
base.AfterConstruction();
CreatedOn = DateTime.Now;
CreatedBy = GetCurrentUser();
}
protected override void OnSaving()
{
base.OnSaving();
UpdatedOn = DateTime.Now;
UpdatedBy = GetCurrentUser();
}
//private string _PersistentProperty;
//[XafDisplayName("My display name"), ToolTip("My hint message")]
//[ModelDefault("EditMask", "(000)-00"), Index(0), VisibleInListView(false)]
//[Persistent("DatabaseColumnName"), RuleRequiredField(DefaultContexts.Save)]
//public string PersistentProperty {
// get { return _PersistentProperty; }
// set { SetPropertyValue(nameof(PersistentProperty), ref _PersistentProperty, value); }
//}
//[Action(Caption = "My UI Action", ConfirmationMessage = "Are you sure?", ImageName = "Attention", AutoCommit = true)]
//public void ActionMethod() {
// // Trigger a custom business logic for the current record in the UI (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112619.aspx).
// this.PersistentProperty = "Paid";
//}
string fCode;
[Size(255)]
//[XafDisplayName("编码")]
public string Code
{
get { return fCode; }
set { SetPropertyValue<string>(nameof(Code), ref fCode, value); }
}
string fName;
[Size(255)]
//[XafDisplayName("名称")]
public string Name
{
get { return fName; }
set { SetPropertyValue<string>(nameof(Name), ref fName, value); }
}
string fAddress;
[Size(255)]
//[XafDisplayName("名称")]
public string Address
{
get { return fAddress; }
set { SetPropertyValue<string>(nameof(Address), ref fAddress, value); }
}
string fLegalRepresentative;
[Size(255)]
//[XafDisplayName("负责人")]
[ModelDefault("AllowEdit", "True")]
public string LegalRepresentative
{
get { return fLegalRepresentative; }
set { SetPropertyValue<string>(nameof(LegalRepresentative), ref fLegalRepresentative, value); }
}
string fContact;
[Size(255)]
//[XafDisplayName("负责人")]
[ModelDefault("AllowEdit", "True")]
public string Contact
{
get { return fContact; }
set { SetPropertyValue<string>(nameof(Contact), ref fContact, value); }
}
private string _Phone;
//[XafDisplayName("电话")]
public string Phone
{
get
{
return _Phone;
}
set
{
SetPropertyValue("Phone", ref _Phone, value);
}
}
string fRemark;
[Size(255)]
//[XafDisplayName("备注")]
public string Remark
{
get { return fRemark; }
set { SetPropertyValue<string>(nameof(Remark), ref fRemark, value); }
}
PermissionPolicyUser createdBy;
[ModelDefault("AllowEdit", "False")]
public PermissionPolicyUser CreatedBy
{
get { return createdBy; }
set { SetPropertyValue("CreatedBy", ref createdBy, value); }
}
DateTime createdOn;
[ModelDefault("AllowEdit", "False"), ModelDefault("DisplayFormat", "G")]
public DateTime CreatedOn
{
get { return createdOn; }
set { SetPropertyValue("CreatedOn", ref createdOn, value); }
}
PermissionPolicyUser updatedBy;
[ModelDefault("AllowEdit", "False")]
public PermissionPolicyUser UpdatedBy
{
get { return updatedBy; }
set { SetPropertyValue("UpdatedBy", ref updatedBy, value); }
}
DateTime updatedOn;
[ModelDefault("AllowEdit", "False"), ModelDefault("DisplayFormat", "G")]
public DateTime UpdatedOn
{
get { return updatedOn; }
set { SetPropertyValue("UpdatedOn", ref updatedOn, value); }
}
}
}
边栏推荐
- 葫芦儿 APP 使用帮助
- 导数的左右极限和左右导数的辨析
- Ucosiii --- engineering transplantation
- srpingboot security demo
- Code shoe set - mt3114 · interesting balance - explain it with examples
- Huluer app help
- Advanced cross platform application development (III): online resource upgrade / hot update with uni app
- 分片上传与断点续传
- OpenGL es: (4) detailed explanation of EGL API (Continued)
- C语言初阶——实现扫雷游戏
猜你喜欢

Excel dynamic chart

LeetCode 最大矩形,最大正方形系列 84. 85. 221. 1277. 1725. (单调栈,动态规划)

Send you through the data cloud

Continuous breakthrough and steady progress -- Review and Prospect of cross platform development technology of mobile terminal

CJC8988带2个立体声耳机驱动器的低功率立体声编解码器

OpenGL es: (5) basic concepts of OpenGL, the process of OpenGL es generating pictures on the screen, and OpenGL pipeline

Seven major technical updates that developers should pay most attention to on build 2022

【考研高数 自用】高数第一章基础阶段思维导图

SystemVerilog学习-10-验证量化和覆盖率

基于LabVIEW的计时器
随机推荐
bat操作ftp上传下载命令
LED lighting used in health lighting
论文学习记录随笔 多标签之LIFT
OpenGL es: (2) relationship between OpenGL es, EGL and glsl
HCM 初学 ( 四 ) - 时间
TiDB单机模拟部署生产环境集群(闭坑实践,亲测有效)
2022 the 8th China International "Internet +" college student innovation and entrepreneurship competition industry proposition track is open for registration!
How to transmit and share 4GB large files remotely in real time?
从诺奖知“边缘计算”的未来!
MySQL数据迁移遇到的一些错误
Trust guessing numbers game
What if the data in the cloud disk is harmonious?
云盘里资料被和谐了,怎么办?
Talking from mlperf: how to lead the next wave of AI accelerator
TIDB数据库特性总结
College community management system based on boot+jsp (with source code download link)
uniapp树形层级选择器
Fixed height of the first column in El table dynamic header rendering
excel初级应用案例——杜邦分析仪
Scope data export mat