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

namespace Sugar.Enties
{
    public class RequisitionDTO
    {
        /// <summary>
        /// 签证编码
        /// </summary>
        public string RequisitionCode { get; set; }
        /// <summary>
        /// 签证单名
        /// </summary>
        public string RequisitionName { get; set; }
        /// <summary>
        /// 申请单编号
        /// </summary>
        public string RequisitionNumber { get; set; }
        /// <summary>
        /// 签证日期
        /// </summary>
        public DateTime? RequisitionDate { get; set; }
        /// <summary>
        /// 签证日期转短日期字符串
        /// </summary>
        public string RequisitionDateStr
        {
            get
            {
                if (RequisitionDate == null)
                {
                    return "";
                }
                else
                {
                    return RequisitionDate.Value.ToString("yyyy-MM-dd");
                }
            }
        }
        /// <summary>
        /// 签证类型
        /// </summary>
        public string ChangeType { get; set; }
        /// <summary>
        /// 签证原因
        /// </summary>
        public string RequisitionReason { get; set; }
        /// <summary>
        /// 项目代码
        /// </summary>
        public string ProjectCode { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 经办人用户代码
        /// </summary>
        public string Person { get; set; }
        /// <summary>
        /// 经办人名称
        /// </summary>
        public string PersonName { get; set; }
        /// <summary>
        /// 经办人所属部门编号
        /// </summary>
        public string UnitCode { get; set; }
        /// <summary>
        /// 经办人部门名称
        /// </summary>
        public string UnitName { get; set; }
        public int State { get; set; }
        /// <summary>
        /// 状态名
        /// </summary>
        public string StateName {
            get
            {
                return Enum.GetName(typeof(CheckState), State);
            }
        }
    }

    /// <summary>
    /// 申请单表单数据
    /// </summary>申请单主表
    public class RequisitionPostForm
    {
        /// <summary>
        /// 签证申请单
        /// </summary>
        public Requisition Requisition { get; set; }
        /// <summary>
        /// 关联合同
        /// </summary>
        public List<RequisitionContract> List { get; set; }
        /// <summary>
        /// 附件列表
        /// </summary>
        public List<AttachMent> AttachMentList { get; set; }
    }
}
