using System.Collections.Generic;
using System.Globalization;

namespace Bp.Sync.Dto.SmartTable
{
    public class SmartTableResult<T>
    {
        public IEnumerable<T> Items { get; set; } = new List<T>();
        public double TotalRecord { get; set; }
        public int NumberOfPages { get; set; }
        public double From { get; set; }
        public double To { get; set; }
        public int LastPage { get; set; }

    }

    public class TransactionSmartTableResult<T> : SmartTableResult<T>
    {
        public decimal? TotalAddAmount { get; set; } = 0;
        public string TotalAddAmountStr => TotalAddAmount.HasValue ? TotalAddAmount.Value.ToString("C0", CultureInfo.CreateSpecificCulture("vi-VN")) : "";
        public decimal? TotalSubAmount { get; set; } = 0;
        public string TotalSubAmountStr => TotalSubAmount.HasValue ? TotalSubAmount.Value.ToString("C0", CultureInfo.CreateSpecificCulture("vi-VN")) : "";
        public int? TotalAddTransaction { get; set; } = 0;
        public int? TotalSubTransaction { get; set; } = 0;
    }
}
