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 UserDto : DtoBase
    {
        /// <summary>
        /// 公司Id
        /// </summary>
        public int CompanyId { get; set; }
        /// <summary>
        /// 部门Id
        /// </summary>
        public int DepId { get;set; }

        /// <summary>
        /// 岗位Id
        /// </summary>
        public int JobPostId { get; set; }
    }
    /// <summary>
    /// 修改用户信息
    /// </summary>
    public class EditUserDto
    {
        /// <summary>
        /// 用户Id
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 工号
        /// </summary>
        public string Number { get; set; }
        /// <summary>
        /// 公司Id
        /// </summary>
        public int CompanyId { get; set; }
        /// <summary>
        /// 部门Id
        /// </summary>
        public int DepId { get; set; }
        /// <summary>
        /// 岗位Id
        /// </summary>
        public int JobPostId { get; set; }
        /// <summary>
        /// 分机号
        /// </summary>
        public string Ext { get; set; }
        /// <summary>
        /// 试用期
        /// </summary>
        public string UsePeriod { get; set; }
        /// <summary>
        /// 人事审核 0未审核(初始状态) 1 已通过（可用）2已拒绝
        /// </summary>
        public int HrAudit { get; set; }
    }

    /// <summary>
    /// 修改个人信息
    /// </summary>
    public class EditMyUserDto
    {
        /// <summary>
        /// 用户Id
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 中文姓名
        /// </summary>
        public string CnName { get; set; }
        /// <summary>
        /// 英文姓名
        /// </summary>
        public string EnName { get; set; }

        /// <summary>
        /// 性别0 男1 女  2 未设置
        /// </summary>
        public int Sex { get; set; }

        private string phone;
        /// <summary>
        /// 手机号
        /// </summary>
        public string Phone
        {
            get
            {
                return phone;
            }
            set
            {
                if (Regex.IsMatch(value, @"^[1]+[2,3,4,5,6,7,8,9]+\d{9}"))
                {
                    phone = value;
                }
                else
                {
                    phone = "";
                }
            }
        }
        private string urgentPhone;
        /// <summary>
        /// 紧急联系人 手机号
        /// </summary>
        public string UrgentPhone
        {
            get { return urgentPhone; }
            set
            {
                if (Regex.IsMatch(value, @"^[1]+[2,3,4,5,6,7,8,9]+\d{9}"))
                {
                    urgentPhone = value;
                }
                else
                {
                    urgentPhone = "";
                }
            }
        }
        private string email;
        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email
        {
            get { return email; }
            set
            {
                if (Regex.IsMatch(value, @"^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(com|cn|net)$"))
                {
                    email = value;
                }
                else
                {
                    email = "";
                }
            }
        }
        /// <summary>
        /// 住址
        /// </summary>
        public string Address { get; set; }
        /// <summary>
        /// 入职时间
        /// </summary>
        public DateTime Edate { get; set; }
        /// <summary>
        /// 生日
        /// </summary>
        public DateTime Birthday { get; set; }
        /// <summary>
        /// 身份证号码
        /// </summary>
        public string IDCard { get; set; }

        /// <summary>
        /// 毕业学校
        /// </summary>
        public string GraduateInstitutions { get; set; }
        /// <summary>
        /// 专业
        /// </summary>
        public string Professional { get; set; }
        /// <summary>
        /// 学历
        /// </summary>
        public int Education { get; set; }
        /// <summary>
        /// 学历类型
        /// </summary>
        public int TheOrAdultEducation { get; set; }
        /// <summary>
        /// 婚姻状态
        /// </summary>
        public string MaritalStatus { get; set; }
        /// <summary>
        /// 家庭地址
        /// </summary>
        public string HomeAddress { get; set; }

        /// <summary>
        /// 工作经历
        /// </summary>
        public string WorkExperience { get; set; }
        /// <summary>
        /// 证书上传
        /// </summary>
        public string Certificate { get; set; }

    }
}
