Search Results for

    Show / Hide Table of Contents

    Class TransactionViewHelper

    A helper class for an implementation of a ILayoutGenerator that has child transactions

    This includes view visibility formulas to make sure the allocations sub views are only visible when the transaction is configured that way

    Inheritance
    object
    TransactionViewHelper
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Client.Core.Views.DefaultLayouts
    Assembly: LemonEdge.ClientCore.dll
    Syntax
    public class TransactionViewHelper

    Constructors

    TransactionViewHelper(EntityDescriptor, IEntityDescriptorFactory, IViewDescriptorInstanceFactory)

    Creates a new transaction view helper for the specified entity type with child transactions

    Declaration
    public TransactionViewHelper(EntityDescriptor desc, IEntityDescriptorFactory entityDescriptorFactory, IViewDescriptorInstanceFactory viewDescriptorInstanceFactory)
    Parameters
    Type Name Description
    EntityDescriptor desc

    The specified entity type that has child transaction views

    IEntityDescriptorFactory entityDescriptorFactory

    The IEntityDescriptorFactory

    IViewDescriptorInstanceFactory viewDescriptorInstanceFactory

    The IViewDescriptorInstanceFactory

    Fields

    DOES_TRANSACTION_HAVE_PARAMS_FORMULA

    Declaration
    public const string DOES_TRANSACTION_HAVE_PARAMS_FORMULA = "\r\nvar head = View.Controller.CurrentDisplayedItem as LemonEdge.API.Entities.FinancialServices.Transactions.ITransaction; \r\nif(head == null) return false;\r\nvar code = head != null ? await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(head.TransactionCodeID) : null; \r\nif(code == null) return false;\r\nreturn code.TransactionSettingLayoutID.HasValue;"
    Field Value
    Type Description
    string

    DOES_TRANSACTION_HAVE_TRANSACTIONSANDGL_FORMULA

    Declaration
    public const string DOES_TRANSACTION_HAVE_TRANSACTIONSANDGL_FORMULA = "\r\nvar head = View.Controller.CurrentDisplayedItem as LemonEdge.API.Entities.FinancialServices.Transactions.ITransaction; \r\nif(head == null) return true;\r\nvar code = head != null ? await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(head.TransactionCodeID) : null; \r\nif(code == null) return true;\r\nreturn code.ShowTransactionsAndGL;"
    Field Value
    Type Description
    string

    HAS_TRANSACTION_ASSOCIATIONS

    Declaration
    public const string HAS_TRANSACTION_ASSOCIATIONS = "\r\nvar code = Item is LemonEdge.API.Entities.FinancialServices.Transactions.ITransaction trn ? await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(trn.TransactionCodeID) : null; \r\nreturn code != null && code.AllowAssociations;"
    Field Value
    Type Description
    string

    IS_GL_ALLOCATED_FORMULA

    Declaration
    public const string IS_GL_ALLOCATED_FORMULA = "\r\nvar head = View.Controller.CurrentDisplayedItem as LemonEdge.API.Entities.FinancialServices.Accounting.IGLPosting; \r\nLemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode code = null;\r\nvar hasAllocations = false;\r\nif(head != null) \r\n{\r\n    var cn = View.Displayer.Controller.MainDisplayedItem.Context;\r\n    var processor = cn.GetProcessor<LemonEdge.API.Entities.FinancialServices.Processors.Transactional.ITransactionProcessor>(head);    \r\n    var trn = processor.GetTransaction(head.ParentTransactionID);\r\n    code = await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(trn.TransactionCodeID); \r\n    hasAllocations = processor.GetGLValuesAllocated(head).Any();\r\n}\r\nelse\r\n{\r\n    code = Item is LemonEdge.API.Entities.FinancialServices.Transactions.ITransaction trn ? await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(trn.TransactionCodeID) : null; \r\n}\r\nreturn code != null && (code.Allocation >= LemonEdge.API.Entities.FinancialServices.Transactions.TransactionCodeAllocation.Automatic || hasAllocations);"
    Field Value
    Type Description
    string

    IS_TRANSACTION_ALLOCATED_FORMULA

    Declaration
    public const string IS_TRANSACTION_ALLOCATED_FORMULA = "\r\nvar head = MyItem as LemonEdge.API.Entities.FinancialServices.Transactions.ITransaction; \r\nvar code = head != null ? await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(head.TransactionCodeID) : null; \r\nif(head == null || code == null) return false;\r\nvar cn = View.Displayer.Controller.MainDisplayedItem.Context;\r\nvar processor = cn.GetProcessor<LemonEdge.API.Entities.FinancialServices.Processors.Transactional.ITransactionProcessor>(head);    \r\nvar hasAllocations = processor.GetTransactionValuesAllocated(head).Any();\r\nreturn code != null && (code.Allocation >= LemonEdge.API.Entities.FinancialServices.Transactions.TransactionCodeAllocation.Automatic || hasAllocations);"
    Field Value
    Type Description
    string

    Properties

    HeaderTransactionsControllerName

    The name of the controller that holds header transactions only

    Declaration
    public string HeaderTransactionsControllerName { get; set; }
    Property Value
    Type Description
    string

    Parent

    Declaration
    public ViewDescriptorInstance Parent { get; set; }
    Property Value
    Type Description
    ViewDescriptorInstance

    Methods

    AddDefaultTransactionViews(LayoutDescriptorGroup, LayoutDescriptorGroup)

    Declaration
    public void AddDefaultTransactionViews(LayoutDescriptorGroup topGroup, LayoutDescriptorGroup bottomGroup)
    Parameters
    Type Name Description
    LayoutDescriptorGroup topGroup
    LayoutDescriptorGroup bottomGroup

    AddDefaultTransactionViews(LayoutDescriptorGroup, LayoutDescriptorGroup, bool)

    Adds the transaction view, values view, allocations, gl posting, and gl posting allocations views to the specified group within a layout

    The parent transaction view is related to the parent entity descriptor these transactions all have as a parent

    Declaration
    public void AddDefaultTransactionViews(LayoutDescriptorGroup topGroup, LayoutDescriptorGroup bottomGroup, bool addHeader)
    Parameters
    Type Name Description
    LayoutDescriptorGroup topGroup

    The top group within the owning layout the header transactions should be added to

    LayoutDescriptorGroup bottomGroup

    The larger bottom group that holds the values, allocations, gl postings and gl posting allocations views within the owning layout

    bool addHeader

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.