using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IronIntel.Contractor.Machines
{
    public class EngineHoursInfo
    {
        public long AssetID { get; set; }
        public string DataSource { get; set; }
        public string SubSource { get; set; }
        public string DataSourceName { get; set; }
        public DateTime AsofTime { get; set; }
        public DateTime AsofTimeLocal { get; set; }
        public bool IsPrimary { get; set; }

        public double Hours { get; set; }
        public string UOM { get; set; }

        private double _Corrected;
        public double Corrected
        {
            get
            {
                return _Corrected;
            }
            set
            {
                value = value > 0 ? value : 0;
                _Corrected = Math.Round(value, 2);
            }
        }
        public string ReceivedDateStr
        {
            get
            {
                return AsofTimeLocal.ToString();
            }
        }
    }

    public class AdjustEngineHoursInfo
    {
        public string CustomerID { get; set; }
        public long AssetID { get; set; }
        public DateTime EngineHoursDate { get; set; }

        private double _EngineHours;
        public double EngineHours
        {
            get
            {
                return _EngineHours;
            }
            set
            {
                value = value > 0 ? value : 0;
                _EngineHours = Math.Round(value, 2);
            }
        }
        public string Notes { get; set; }
        /// <summary>
        /// 前端选择的时区的分钟偏移
        /// </summary>
        public int OffsetMinute { get; set; }
        public string DataSource { get; set; }
    }


    public class CalampEngineHoursInfo
    {
        public long AssetId { get; set; }
        public string DeviceAirId { get; set; }
        public DateTime AsofTime { get; set; }
        public string UOM { get; set; }
        public double Gps { get; set; }
        public double Gps_Calc { get; set; }
        public double VBUS { get; set; }
        public double VBUS_Calc { get; set; }
        public string EventTimeText
        {
            get
            {
                return AsofTime.ToString("M/d/yyyy h:mm tt");
            }
        }
        public DateTime AsofTimeLocal { get; set; }
        public string EventTimeLocalText
        {
            get
            {
                return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
            }
        }
    }


    public class PedigreeEngineHoursInfo
    {
        public long AssetId { get; set; }
        public string DeviceSN { get; set; }
        public DateTime AsofTime { get; set; }
        public string UOM { get; set; }
        public double VBUS { get; set; }
        public double VBUS_Calc { get; set; }
        public string EventTimeText
        {
            get
            {
                return AsofTime.ToString("M/d/yyyy h:mm tt");
            }
        }
        public DateTime AsofTimeLocal { get; set; }
        public string EventTimeLocalText
        {
            get
            {
                return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
            }
        }
    }
    public class OEMDD2EngineHoursInfo
    {
        public long AssetId { get; set; }
        public string SN { get; set; }
        public DateTime AsofTime { get; set; }
        public string UOM { get; set; }
        public double Raw { get; set; }
        public double Calculated { get; set; }
        public string EventTimeText
        {
            get
            {
                return AsofTime.ToString("M/d/yyyy h:mm tt");
            }
        }
        public DateTime AsofTimeLocal { get; set; }
        public string EventTimeLocalText
        {
            get
            {
                return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
            }
        }
    }

    public class AssetEngineHoursAdjustItem
    {
        public long LogId { get; set; }
        public long AssetId { get; set; }
        public string DisplayName { get; set; }//Asset Name
        public string VIN { get; set; }
        public DateTime AdjustmentTime { get; set; }
        public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:mm tt"); } }
        public DateTime EngineHoursTime { get; set; }
        public string EngineHoursTimeText { get { return EngineHoursTime.ToString("M/d/yyyy h:mm tt"); } }
        public DateTime AdjustmentLocalTime { get; set; }
        public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt"); } }
        public DateTime EngineHoursLocalTime { get; set; }
        public string EngineHoursLocalTimeText { get { return EngineHoursLocalTime.ToString("M/d/yyyy h:mm tt"); } }

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

        public string Notes { get; set; }
        public string UserName { get; set; }

    }
}
