XAF 14.1 DC implements custom audit log information

Source: Internet
Author: User

Due to the needs of a system, you need to add custom information in the log, and you need to filter to display some of the actions recorded in the changes, delete, etc., the other does not display, the specific implementation method is as follows:

First, the need to inherit auditdataitempersistent, the specific code is as follows:

        Public Myauditdataitempersistent (DevExpress.Xpo.Session session)            : Base (session)        {        }        [ Xafdisplayname ("Modify caption")] public        string propertycaption        {            get            {                if (auditedobject! = null)                {                    Try                    {                        var caption = captionhelper.getmembercaption (AuditedObject.Target.GetType (), PropertyName);                        return caption;                    }                    Catch {}                }                return string. Empty;}}}    

Second, the storage object of setting audit in WinApplication.cs is Myauditdataitempersistent

Three

    [Xafdisplayname ("Modify Log")]    Ilist<myauditdataitempersistent>xt_order_review_detail_audit {get;} [Domainlogic (typeof (XT_ORDER_REVIEW_DETAIL_DC))] public class Contactlogic {private static xpcollection<m        Yauditdataitempersistent> _changehistory; public static ilist<myauditdataitempersistent> Get_xt_order_review_detail_audit (XT_ORDER_REVIEW_DETAIL_DC obj, Iobjectspace os) {var source = Auditedobjectweakreference.getaudittrail ((xpobjectspac (e) OS).            Session, obj); if (Source = null) {try {_changehistory = new xpcollection& Lt Myauditdataitempersistent> (((xpobjectspace) OS).                    Session, source);                _changehistory.filter = Criteriaoperator.parse ("operationtype= ' objectchanged '");             } catch {}} return _changehistory; Return (myauditdataitempersistent) devexpress.persisteNt. BaseImpl.AuditedObjectWeakReference.GetAuditTrail (((xpobjectspace) OS).        Session, obj); }

XAF 14.1 DC implements custom audit log information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.