当前位置:网站首页>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); }
}
}
}
边栏推荐
- Excel dynamic chart
- HCM 初学 ( 三 ) - 快速输入PA70、PA71 浏览员工信息PA10
- Advanced cross platform application development (III): online resource upgrade / hot update with uni app
- Continue to learn MySQL
- OpenGL ES: (3) EGL、EGL绘图的基本步骤、EGLSurface、ANativeWindow
- Call us special providers of personal cloud services for College Students
- 扩展点系列之SmartInstantiationAwareBeanPostProcessor确定执行哪一个构造方法 - 第432篇
- PLA不粘贴在床上:6个简单的解决方案
- Dear pie users, I want to confess to you!
- π disk, turning your computer into a personal private cloud
猜你喜欢
Educational administration management system of SSM (free source code)

What if the data in the cloud disk is harmonious?

Dear pie users, I want to confess to you!

Learn the customization and testing of fpga---ram IP from the bottom structure

Call us special providers of personal cloud services for College Students

Ssm+mysql second-hand trading website (thesis + source code access link)

El tooltip in the table realizes line breaking display

HCM 初学 ( 二 ) - 信息类型

【知识点总结】卡方分布,t分布,F分布

穿越派·派盘 + 思源笔记 = 私人笔记本
随机推荐
LED lighting used in health lighting
Oracle create user + Role
千万不要把笔记视频乱放!
Advanced cross platform application development (II): uni app practice
Educational administration management system of SSM (free source code)
Ssm+mysql second-hand trading website (thesis + source code access link)
Multi label lsml for essay learning records
扩展点系列之SmartInstantiationAwareBeanPostProcessor确定执行哪一个构造方法 - 第432篇
加密狗资料搜集
表格中el-tooltip 实现换行展示
1034 Head of a Gang
Oracle sequence + trigger
On the first day of the new year, 3000 Apache servers went down
Idea start view project port
Don't put your notes and videos everywhere!
Through cooperation with the University of international trade, we can increase efficiency for college students
TIDB数据库特性总结
2022 年面向初学者的 10 大免费 3D 建模软件
tese_ Time_ 2h
C语言初阶——实现扫雷游戏