当前位置:网站首页>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); }
}
}
}
边栏推荐
- π disk, turning your computer into a personal private cloud
- Vscode function annotation / file header annotation shortcut
- Educational administration management system (free source code)
- 分片上传与断点续传
- El tooltip in the table realizes line breaking display
- C language beginner level - realize the minesweeping game
- FPGA - 7系列 FPGA内部结构之Clocking -02- 时钟布线资源
- Smartinstantiationawarebeanpostprocessor of the extension point series determines which construction method to execute - Chapter 432
- Huluer app help
- 为了保护自己的数据,他奋斗了一天一夜
猜你喜欢

穿越派·派盘 + Mountain Duck = 数据本地管理

Leetcode Max rectangle, Max square series 84 85. 221. 1277. 1725. (monotonic stack, dynamic programming)
Educational administration management system of SSM (free source code)

扩展点系列之SmartInstantiationAwareBeanPostProcessor确定执行哪一个构造方法 - 第432篇

喊我们大学生个人云服务特供商

论文学习记录随笔 多标签之LSML

Crossing sect · paipan + Siyuan notes = private notebook

On the first day of the new year, 3000 Apache servers went down

Advanced drawing skills of Excel lecture 100 (1) - use Gantt chart to show the progress of the project

excel初级应用案例——杜邦分析仪
随机推荐
Xuanyi maintenance manual
excel高级绘图技巧100讲(一)-用甘特图来展示项目进度情况
导数的左右极限和左右导数的辨析
【考研高数 武忠祥+880版 自用】高数第二章基础阶段思维导图
Call us special providers of personal cloud services for College Students
Enter an expression (expressed as a string) and find the value of this expression.
Codeforces Round #803 (Div. 2)vp
Dear pie users, I want to confess to you!
【考研高数 自用】高数第一章基础阶段思维导图
Talking from mlperf: how to lead the next wave of AI accelerator
FPGA - 7系列 FPGA内部结构之Clocking -02- 时钟布线资源
[medical segmentation] u2net
el-table 动态表头渲染 固定第一列 高度问题
为了保护自己的数据,他奋斗了一天一夜
Data governance: data governance management (Part V)
π盘,让您电脑变成个人的私有云
Build 2022 上开发者最应关注的七大方向主要技术更新
First defined here occurs during QT compilation. Causes and Solutions
excel初级应用案例——杜邦分析仪
excel可视化