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

namespace OASystem.Domain.Dtos.System
{
    /// <summary>
    /// 企业添加Dto
    /// </summary>
    public class AddCompanyDto
    {
        /// <summary>
        /// 公司Code
        /// </summary>
        public string CompanyCode { get; set; }
        /// <summary>
        /// 公司名称
        /// </summary>
        public string CompanyName { get; set; }

        /// <summary>
        /// 公司所在地
        /// </summary>
        public string Address { get; set; }
        /// <summary>
        /// 负责人Id
        /// </summary>
        public int ContactUserId { get; set; }
        /// <summary>
        /// 联系方式
        /// </summary>
        private string tel;
        public string Tel
        {
            get
            {
                return tel;
            }
            set
            {
                if (Regex.IsMatch(value, @"^[1]+[2,3,4,5,6,7,8,9]+\d{9}"))
                {
                    tel = value;
                }
                else
                {
                    tel = "";
                }
               
            }
        }
        /// <summary>
        /// 父级公司Id
        /// </summary>
        public int ParentCompanyId { get; set; }

        /// <summary>
        /// 创建者Id
        /// </summary>

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

    /// <summary>
    /// 修改企业dto
    /// </summary>
    public class EditCompanyDto
    {
        /// <summary>
        /// 公司Id
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 公司Code
        /// </summary>
        public string CompanyCode { get; set; }
        /// <summary>
        /// 公司名称
        /// </summary>
        public string CompanyName { get; set; }

        /// <summary>
        /// 公司所在地
        /// </summary>
        public string Address { get; set; }
        /// <summary>
        /// 负责人Id
        /// </summary>
        public int ContactUserId { get; set; }
        /// <summary>
        /// 联系方式
        /// </summary>
        private string tel;
        public string Tel
        {
            get
            {
                return tel;
            }
            set
            {
                if (Regex.IsMatch(value, @"^[1]+[2,3,4,5,6,7,8,9]+\d{9}"))
                {
                    tel = value;
                }
                else
                {
                    tel = "";
                }

            }
        }
        /// <summary>
        /// 父级公司Id
        /// </summary>
        public int ParentCompanyId { get; set; }

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

    }

    /// <summary>
    /// 删除企业dto
    /// </summary>
    public class DelCompanyDto
    {
        /// <summary>
        /// 公司Id
        /// </summary>
        public int Id { get; set; }
    }
}
