当前位置:网站首页>XAF Bo of dev XPO comparison
XAF Bo of dev XPO comparison
2022-07-01 06:06:00 【qq_ sixteen million two hundred and fifteen thousand nine hundr】
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(" code ")]
public string Code
{
get { return fCode; }
set { SetPropertyValue<string>(nameof(Code), ref fCode, value); }
}
string fName;
[Size(255)]
//[XafDisplayName(" name ")]
public string Name
{
get { return fName; }
set { SetPropertyValue<string>(nameof(Name), ref fName, value); }
}
string fAddress;
[Size(255)]
//[XafDisplayName(" name ")]
public string Address
{
get { return fAddress; }
set { SetPropertyValue<string>(nameof(Address), ref fAddress, value); }
}
string fLegalRepresentative;
[Size(255)]
//[XafDisplayName(" person in charge ")]
[ModelDefault("AllowEdit", "True")]
public string LegalRepresentative
{
get { return fLegalRepresentative; }
set { SetPropertyValue<string>(nameof(LegalRepresentative), ref fLegalRepresentative, value); }
}
string fContact;
[Size(255)]
//[XafDisplayName(" person in charge ")]
[ModelDefault("AllowEdit", "True")]
public string Contact
{
get { return fContact; }
set { SetPropertyValue<string>(nameof(Contact), ref fContact, value); }
}
private string _Phone;
//[XafDisplayName(" Telephone ")]
public string Phone
{
get
{
return _Phone;
}
set
{
SetPropertyValue("Phone", ref _Phone, value);
}
}
string fRemark;
[Size(255)]
//[XafDisplayName(" remarks ")]
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
- Multi label lsml for essay learning records
- Fragment upload and breakpoint resume
- LED lighting used in health lighting
- SQL必会题之留存率
- 论文学习记录随笔 多标签之GLOCAL
- Database problems, how to optimize Oracle SQL query statements faster and more efficient
- 4GB大文件,如何实时远程传输和共享?
- Timer based on LabVIEW
- Transformer le village de tiantou en un village de betteraves sucrières
猜你喜欢

Send you through the data cloud

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

68 Cesium代码datasource加载czml

FPGA - 7系列 FPGA内部结构之Clocking -02- 时钟布线资源

Chip, an empire built on sand!

Multi label lsml for essay learning records

3D printer threading: five simple solutions

Timer based on LabVIEW

OpenGL es: (3) EGL, basic steps of EGL drawing, eglsurface, anativewindow

On the first day of the new year, 3000 Apache servers went down
随机推荐
PLA不粘贴在床上:6个简单的解决方案
Some errors encountered in MySQL data migration
穿越派 你的数据云行
【文件系统】如何在ubi之上运行squashfs
π disk, turning your computer into a personal private cloud
Primary application case of Excel DuPont analyzer
Make Tiantou village sweet. Is Xianjing taro or cabbage the characteristic agricultural product of Tiantou Village
Database problems, how to optimize Oracle SQL query statements faster and more efficient
ONEFLOW source code parsing: automatic inference of operator signature
OpenGL ES: (5) OpenGL的基本概念、OpenGL ES 在屏幕产生图片的过程、OpenGL管线(pipeline)
2022 the 8th China International "Internet +" college student innovation and entrepreneurship competition industry proposition track is open for registration!
DEV XPO对比之UOW
Send you through the data cloud
SystemVerilog学习-07-类的继承和包的使用
讓田頭村變甜頭村的特色農產品是仙景芋還是白菜
Codeforces Round #803 (Div. 2)vp
浏览器端保存数据到本地文件
论文学习记录随笔 多标签之LIFT
LED lighting used in health lighting
It's not that you have a bad mind, but that you haven't found the right tool