当前位置:网站首页>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); }
}
}
}
边栏推荐
- 关于一道01背包问题的·拓展题的思考
- Crossing sect · paipan + Siyuan notes = private notebook
- PLA不粘貼在床上:6個簡單的解决方案
- Smartinstantiationawarebeanpostprocessor of the extension point series determines which construction method to execute - Chapter 432
- 千万不要把笔记视频乱放!
- restframework-simpleJWT重写认证机制
- QT write custom control - self drawn battery
- On the first day of the new year, 3000 Apache servers went down
- Code shoe set - mt3114 · interesting balance - explain it with examples
- HCM 初学 ( 二 ) - 信息类型
猜你喜欢

El tooltip in the table realizes line breaking display
![[QT] QT after addition, subtraction, multiplication and division, two decimal places are reserved](/img/30/c802ae9b65601832bf52e760e9962d.png)
[QT] QT after addition, subtraction, multiplication and division, two decimal places are reserved

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

Fixed height of the first column in El table dynamic header rendering

基于LabVIEW的计时器

如何添加葫芦儿派盘

从MLPerf谈起:如何引领AI加速器的下一波浪潮

不是你脑子不好用,而是因为你没有找到对的工具

这才是大学生必备软件 | 知识管理

Through cooperation with the University of international trade, we can increase efficiency for college students
随机推荐
导数的左右极限和左右导数的辨析
【知识点总结】卡方分布,t分布,F分布
Educational administration management system (free source code)
穿越派与贸大合作,为大学生增添效率
A little assistant for teenagers' physiological health knowledge based on wechat applet (free source code + project introduction + operation introduction + operation screenshot + Thesis)
输入一个表达式(用字符串表示),求这个表达式的值。
linux 关闭redis 进程 systemd+
【笔记】电商订单数据分析实战
Some errors encountered in MySQL data migration
分片上传与断点续传
On the first day of the new year, 3000 Apache servers went down
PLA不粘贴在床上:6个简单的解决方案
Build 2022 上开发者最应关注的七大方向主要技术更新
This is the necessary software for college students 𞓜 knowledge management
FPGA - 7系列 FPGA内部结构之Clocking -01- 时钟架构概述
Fixed height of the first column in El table dynamic header rendering
OpenGL ES: (2) OpenGL ES 与 EGL、GLSL的关系
HCM 初学 ( 三 ) - 快速输入PA70、PA71 浏览员工信息PA10
OpenGL es: (3) EGL, basic steps of EGL drawing, eglsurface, anativewindow
El tooltip in the table realizes line breaking display