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

namespace OASystem.Domain.Dtos.Resource
{
    public class OperationCountryFeeCostDto
    {
        /// <summary>
        /// 操作状态
        /// 1 添加 
        /// 2 修改 
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 编号
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 洲名
        /// </summary>
        public string VisaContinent { get; set; }

        /// <summary>
        /// 国家名
        /// </summary>
        public string VisaCountry { get; set; }

        /// <summary>
        /// 是否免签 0:是 1:否
        /// </summary>
        public int IsVisaExemption { get; set; }
        /// <summary>
        /// 是否落地签 0:是 1:否
        /// </summary>
        public int IsVisaOnArrival { get; set; }
        /// <summary>
        /// 是否电子签 0:是 1:否
        /// </summary>
        public int IsElectronicSignature { get; set; }

        private decimal visaPrice;
        /// <summary>
        /// 签证费用
        /// </summary>
        public decimal VisaPrice
        {
            get { return visaPrice; }
            set
            {
                Regex reg = new Regex(@"[^0-9]{1,17}([.]{1}[^0-9]{1,4})?$");
                if (!reg.IsMatch(value.ToString()))
                {
                    visaPrice = Convert.ToDecimal(value);
                }
                else
                {
                    visaPrice = 0;
                }
            }
        }


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

        /// <summary>
        /// 签证类型 大公务/小公务/大小公务同时免签
        /// </summary>
        public string VisaType { get; set; }

        private string visaTime;
        /// <summary>
        /// 一般签证时间
        /// </summary>
        public string VisaTime 
        { 
            get { return visaTime; }
            set
            {
                int s = -1;
                if (int.TryParse(value,out s))
                {
                    visaTime = value;
                }
                else
                {
                    ugentTime = "1";
                }
            }
        }

        /// <summary>
        /// 签证是否加急 0:加急  1: 不加急
        /// </summary>
        public int IsUrgent { get; set; }

        private string ugentTime;
        /// <summary>
        /// 加急时间 
        /// </summary>
        public string UrgentTime
        {
            get { return ugentTime; }
            set
            {
                int s = -1;
                if (int.TryParse(value, out s))
                {
                    ugentTime = value;
                }
                else
                {
                    ugentTime = "1";
                }
            }
        }
        private decimal urgentPrice;
        /// <summary>
        /// 加急费用
        /// </summary>
        public decimal UrgentPrice
        {
            get { return urgentPrice; }
            set
            {
                Regex reg = new Regex(@"[^0-9]{1,17}([.]{1}[^0-9]{1,4})?$");
                if (!reg.IsMatch(value.ToString()))
                {
                    urgentPrice = Convert.ToDecimal(value);
                }
                else
                {
                    urgentPrice = 0;
                }
            }
        }

        /// <summary>
        /// 加急费用描述 
        /// </summary>
        public string UrgentPriceDesc { get; set; }

        /// <summary>
        /// 签证地址
        /// </summary>
        public string VisaAddress { get; set; }
        /// <summary>
        /// 创建者Id
        /// </summary>
        public int CreateUserId { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
       
    }
    public class DelCountryFeeCostDto
    {
        public int Id { get; set; }
        public int DeleteUserId { get; set; }
    }
}
