using Foresight;
using Foresight.Fleet.Services.Asset;
using Foresight.Fleet.Services.MapView;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IronIntel.Contractor.MapView
{
    public class AssetDetailViewItem
    {
        public string CompanyID { get; set; } = "";
        public string CompanyName { get; set; } = "";

        private double _EngineHours;
        public double EngineHours
        {
            get
            {
                return _EngineHours;
            }
            set
            {
                value = value > 0 ? value : 0;
                _EngineHours = Math.Round(value, 2);
            }
        }
        public DateTime EngineHoursDate { get; set; }
        public string GroupNames { get; set; }

        private double _Odometer;
        public double Odometer
        {
            get
            {
                return _Odometer;
            }
            set
            {
                value = value > 0 ? value : 0;
                _Odometer = Math.Round(value, 2);
            }
        }
        public string OdometerUOM { get; set; }
        public int MakeYear { get; set; }
        public string AssetType { get; set; }
        public string Model { get; set; }
        public string Make { get; set; }
        public string VIN { get; set; }
        public string Name2 { get; set; }
        public string Name { get; set; }
        public long ID { get; set; }
        public string IconUrl { get; set; }
        public string AssetIconUrl { get; set; }
        public string Description { get; set; }
        public LocationViewItem Location { get; set; }
        public string EngineHoursDateText
        {
            get
            {
                if (EngineHoursDate != DateTime.MinValue)
                {
                    return EngineHoursDate.ToString();
                }
                return "";
            }
        }
        public string DisplayName { get; set; }
    }

    public class AssetLocationHistoryViewItem
    {
        public AssetBasicInfo Machine { get; set; }
        public LocationViewItem[] Locations { get; set; }
    }

    public class AlertLayerPivotViewItem
    {
        public string ID { get; set; }
        public string Caption { get; set; }
        public string Name { get; set; }
        public DataTypes DataType { get; set; }
        public string DefaultValue { get; set; }
        public string ParameterValue { get; set; }
        public QueryParameterDisplayStyles DisplayStyle { get; set; }
        public string LookupDatasourceID { get; set; }
        public bool DisplayCaptionField { get; set; }
        public bool IsField { get; set; }
        public bool IsAllAllowed { get; set; }
        public bool MutipleSelect { get; set; }
        public bool IsCriteriaSQL { get; set; }
    }
}