Galaktikasoft

PeriodStruct Property Editor

PeriodStruct Property Editor is intended for Xafari.Base.PeriodStruct property. This property allows you to store various time interval values. It is very useful to filter the list by a column containing DateTime value. PeriodStruct Property Editor is used in Xafari Extra Filters.

Let's see an example with Timetable object:

public class Timetable : BaseObject
{
    public Timetable(Session session) : base(session) { }

    public string Task { get; set; }

    public string EmployeeName { get; set; }

    public DateTime EmployeePlacementDate { get; set; }

    [Persistent]
    public PeriodStruct WorkPeriod { get; set; }
}

Note, that WorkPeriod property is persistent and decorated with an appropriate attribute.

To see how to activate PeriodStruct Property Editor refer to the documentation. PeriodStruct Property Editor ( PeriodStruct Web Property Editor) is a default editor for PeriodStruct type.

Win-version has a more rich user interface, which allows setting a period in several ways:

- Set the start date and end date:

- Set period explicitly

Win version provides several ready-to-use periods, such as Year, Quarter, Month etc. It greatly facilitates the task to set time intervals.

Web-version provides only one way: to set start-date and end-date.

PeriodStruct Property Editor controls that the start-date is less than the end-date. It allows the user to avoid possible errors, and thus improve its performance.

As you can see in the image above, the value of the start and end of the interval mutually limit each other. The user can not set end value less than the start of the interval. Calendar displays invalid values in gray, that informs the user of the impossibility of their choice.

To use PeriodStruct to filter, you must configure the Application Model. Navigate to the business object node and set PeriodFilterProperty.

Application Model will expose PeriodFilterProperty after adding Xafari.Filters and Xafari.Filters.Win modules. The special Popup Container Show Action will be displayed in the UI. Set period and the list will be filtered by the column specified in Application Model (i.e. EmployeePlacementDate).

Sample: DateEditors.