using OASystem.Domain.Entities.Groups;
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OASystem.Domain.ViewModels.Groups
{
    /// <summary>
    /// 出入境费用 View
    /// </summary>
    public class EnterExitCostView:Grp_EnterExitCost { }

    /// <summary>
    /// 出入境国家(城市)费用标准 View
    /// </summary>
    public class NationalTravelFeeView : Grp_NationalTravelFee { }

    /// <summary>
    /// 出入境国家(城市)费用标准Info  View
    /// </summary>
    public class NationalTravelFeeInfoView
    {
        /// <summary>
        /// Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 洲别
        /// </summary>
        public string? Continent { get; set; }

        /// <summary>
        /// 国家
        /// </summary>
        public string? Country { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        public string? City { get; set; }

        /// <summary>
        /// 币种
        /// Sys_SetData STid=66
        /// </summary>
        public int Currency { get; set; }

        /// <summary>
        /// 币种code
        /// </summary>
        public string? CurrencyCode { get; set; }

        /// <summary>
        /// 币种Name
        /// </summary>
        public string? CurrencyName { get; set; }

        /// <summary>
        /// 住宿费
        /// </summary>
        public decimal RoomCost { get; set; } = 0;

        /// <summary>
        /// 伙食费
        /// </summary>
        public decimal FoodCost { get; set; } = 0;

        /// <summary>
        /// 公杂费 
        /// </summary>
        public decimal PublicCost { get; set; } = 0;

        /// <summary>
        /// 最后更新人 Id 
        /// </summary>
        public int LastUpdateUserId { get; set; }

        /// <summary>
        /// 最后更新人 name
        /// </summary>
        public string? LastUpdateUserName { get; set; }

        /// <summary>
        /// 最后更新时间 
        /// </summary>
        public DateTime? LastUpdateTime { get; set; }
    }

    /// <summary>
    /// 出入境国家(城市)费用标准 Page Info  View
    /// </summary>
    public class NationalTravelFeePageInfoView
    {
        /// <summary>
        /// 行号
        /// </summary>
        public int RowNumber { get; set; }

        public int Id { get; set; }

        /// <summary>
        /// 洲别
        /// </summary>
        public string? Continent { get; set; }

        /// <summary>
        /// 国家
        /// </summary>
        public string? Country { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        public string? City { get; set; }

        /// <summary>
        /// 币种
        /// Sys_SetData STid=66
        /// </summary>
        public int Currency { get; set; }

        /// <summary>
        /// 币种code
        /// </summary>
        public string CurrencyCode { get; set; }

        /// <summary>
        /// 币种名称
        /// </summary>
        public string CurrencyName { get; set; }

        /// <summary>
        /// 住宿费
        /// </summary>
        public decimal RoomCost { get; set; }

        /// <summary>
        /// 伙食费
        /// </summary>
        public decimal FoodCost { get; set; }

        /// <summary>
        /// 公杂费 
        /// </summary>
        public decimal PublicCost { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 最后更新人 
        /// </summary>
        public int LastUpdateUserId { get; set; }

        /// <summary>
        /// 最后更新人
        /// </summary>
        public string LastUpdateUserName { get; set; }

        /// <summary>
        /// 最后更新时间 
        /// </summary>
        public DateTime? LastUpdateTime { get; set; } = DateTime.Now;

    }

    /// <summary>
    /// 出入境国家(城市)费用标准 Info  View
    /// </summary>
    public class NationalTravelFeeInfoByCountryAndCityView
    {
        /// <summary>
        /// 洲别
        /// </summary>
        public string? Continent { get; set; }

        /// <summary>
        /// 国家
        /// </summary>
        public string? Country { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        public string? City { get; set; }

        /// <summary>
        /// 币种
        /// Sys_SetData STid=66
        /// </summary>
        public int Currency { get; set; }

        /// <summary>
        /// 币种code
        /// </summary>
        public string CurrencyCode { get; set; }

        /// <summary>
        /// 币种名称
        /// </summary>
        public string CurrencyName { get; set; }

        /// <summary>
        /// 住宿费
        /// </summary>
        public decimal RoomCost { get; set; }

        /// <summary>
        /// 伙食费
        /// </summary>
        public decimal FoodCost { get; set; }

        /// <summary>
        /// 公杂费 
        /// </summary>
        public decimal PublicCost { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 最后更新人 
        /// </summary>
        public int LastUpdateUserId { get; set; }

        /// <summary>
        /// 最后更新人
        /// </summary>
        public string LastUpdateUserName { get; set; }

        /// <summary>
        /// 最后更新时间 
        /// </summary>
        public DateTime? LastUpdateTime { get; set; } = DateTime.Now;

    }

    /// <summary>
    /// 出入境费用info
    /// </summary>
    public class EnterExitCostInfoView
    {
        /// <summary>
        /// Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 团组Id
        /// </summary>
        public int DiId { get; set; }

        /// <summary>
        /// 境内费用(其他费用)
        /// </summary>
        public decimal InsidePay { get; set; }

        #region 境内费用(其他费用)子项

        /// <summary>
        /// 签证费
        /// </summary>
        public decimal Visa { get; set; }

        /// <summary>
        /// 签证费描述
        /// </summary>
        public string? VisaRemark { get; set; }

        /// <summary>
        /// 疫苗费
        /// </summary>
        public decimal YiMiao { get; set; }

        /// <summary>
        /// 核酸检测费用
        /// </summary>
        public decimal HeSuan { get; set; }

        /// <summary>
        /// 服务费用
        /// </summary>
        public decimal Service { get; set; }

        /// <summary>
        /// 参展门票
        /// </summary>
        public decimal Ticket { get; set; }

        /// <summary>
        /// 保险费
        /// </summary>
        public decimal Safe { get; set; }

        #endregion

        /// <summary>
        /// 国际旅费合计（经济舱）
        /// </summary>
        public decimal OutsideJJPay { get; set; }

        /// <summary>
        ///  国际旅费合计（公务舱）
        /// </summary>
        public decimal OutsaideGWPay { get; set; }

        #region 国际旅费合计(经济舱\公务舱)

        /// <summary>
        ///  国际机票（经济舱）
        /// </summary>
        public decimal AirJJ { get; set; }

        /// <summary>
        ///  国际机票（公务舱）
        /// </summary>
        public decimal AirGW { get; set; }

        /// <summary>
        ///  国外城市间交通费
        /// </summary>
        public decimal CityTranffic { get; set; }


        #region 汇率币种

        /// <summary>
        ///  多个币种存储
        ///  存储方式： 美元(USD):6.2350|.......|墨西哥比索(MXN):1.0000
        /// </summary>
        public List<CurrencyInfo>? Currencys{ get; set; }

        #endregion

        #endregion

        #region 选择框状态

        /// <summary>
        ///  境内费用(其他费用)选择框
        /// </summary>
        public int ChoiceOne { get; set; }

        /// <summary>
        ///  国际旅费合计选择框
        /// </summary>
        public int ChoiceTwo { get; set; }

        /// <summary>
        ///  经济舱小计选择框
        /// </summary>
        public int SumJJC { get; set; }

        /// <summary>
        ///  公务舱小计选择框
        /// </summary>
        public int SumGWC { get; set; }

        /// <summary>
        ///  住宿费合计选择框
        /// </summary>
        public int ChoiceThree { get; set; }

        /// <summary>
        /// 住宿费子项Data
        /// </summary>
        public List<DayAndCostInfoView>? QuarterageData { get; set; }

        /// <summary>
        ///  伙食费合计选择框
        /// </summary>
        public int ChoiceFour { get; set; }

        /// <summary>
        /// 伙食费子项Data
        /// </summary>
        public List<DayAndCostInfoView>? BoardWagesData { get; set; }

        /// <summary>
        ///  公杂费合计选择框
        /// </summary>
        public int ChoiceFive { get; set; }

        /// <summary>
        /// 公杂费子项Data
        /// </summary>
        public List<DayAndCostInfoView>? MiscellaneousFeeData { get; set; }

        /// <summary>
        ///  培训费用选择框
        /// </summary>
        public int ChoiceSix { get; set; }

        /// <summary>
        /// 培训费子项Data
        /// </summary>
        public List<DayAndCostInfoView>? TrainingExpenseData { get; set; }

        /// <summary>
        /// 经济舱选择框
        /// </summary>
        public int AirJJC_Checked { get; set; }

        /// <summary>
        /// 公务舱选择框
        /// </summary>
        public int AirGWC_Checked { get; set; }

        #endregion
    }

    /// <summary>
    /// 出入境国家(城市)费用标准子项Info  View
    /// </summary>
    public class DayAndCostInfoView
    {
        /// <summary>
        /// Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 团组Id
        /// </summary>
        public int DiId { get; set; }

        /// <summary>
        /// 类型:1为住宿费;2为伙食费;3为公杂费;4培训费用
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// 类型名称
        /// </summary>
        public string? TypeName
        {
            get
            {
                string str = "";
                if (Type == 1) str = string.Format("住宿费");
                else if (Type == 2) str = string.Format("伙食费");
                else if (Type == 3) str = string.Format("公杂费");
                else if (Type == 4) str = string.Format("培训费");
                return str;
            }
        }

        /// <summary>
        /// 天数
        /// </summary>
        public int Days { get; set; }

        /// <summary>
        /// 出入境国家费用标准 - Id
        /// </summary>
        public int NationalTravelFeeId { get; set; }

        /// <summary>
        /// 出入境国家费用标准 - 国家
        /// </summary>
        public string? Country { get; set; }

        /// <summary>
        /// 出入境国家费用标准 - 城市
        /// </summary>
        public string? City { get; set; }

        ///// <summary>
        ///// 地名
        ///// </summary>
        //public string? Place { get; set; }

        /// <summary>
        /// 地名
        /// </summary>
        public string? PlaceName
        {
            get
            {
                string str = "";
                if (!string.IsNullOrEmpty(Country))
                {
                    if (City.Contains("城市")) str = Country;
                    else str = City;
                }

                return str;

            }
        }

        /// <summary>
        /// 费用标准
        /// </summary>
        public decimal Cost { get; set; }

        /// <summary>
        /// 币种 Id
        /// Sys_SetData STid = 66
        /// </summary>
        public int Currency { get; set; }

        /// <summary>
        /// 币种Code
        /// </summary>
        public string? CurremcyCode { get; set; }

        /// <summary>
        /// 币种名称
        /// </summary>
        public string? CurrencyName { get; set; }

        /// <summary>
        /// 小计
        /// </summary>
        public decimal SubTotal { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; } = "";
    }


    /// <summary>
    /// 出入境国家(城市)费用标准子项Add  View
    /// </summary>
    public class DayAndCostAddView
    {
        /// <summary>
        /// 主键编号
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 团组Id
        /// </summary>
        public int DiId { get; set; }

        /// <summary>
        /// 类型:1为住宿费;2为伙食费;3为公杂费;4培训费用
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// 天数
        /// </summary>
        public int Days { get; set; }

        /// <summary>
        /// 出入境国家费用标准 - Id
        /// </summary>
        public int NationalTravelFeeId { get; set; }

        /// <summary>
        /// 费用标准
        /// </summary>
        public decimal Cost { get; set; }

        /// <summary>
        /// 币种 Id
        /// Sys_SetData STid = 66
        /// </summary>
        public int Currency { get; set; }

        /// <summary>
        /// 小计
        /// </summary>
        public decimal SubTotal { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; } = "";
    }

    /// <summary>
    /// 币种详情
    /// </summary>
    public class CurrencyInfo
    {
        /// <summary>
        /// 币种Code
        /// </summary>
        public string? CurrencyCode { get; set; }

        /// <summary>
        /// 币种名称
        /// </summary>
        public string? CurrencyName { get; set; }

        /// <summary>
        /// 币种当时汇率
        /// </summary>
        public decimal Rate { get; set; }
    }
}
