using OASystem.Domain.Entities.Customer;
using OASystem.Domain.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OASystem.Domain.ViewModels.CRM
{
    /// <summary>
    /// 
    /// </summary>
    public class TableOperationRecordView : Crm_TableOperationRecord
    {
    }

    /// <summary>
    /// 操作记录page
    /// </summary>
    public class TableOperationRecordPageView
    {
        public int Row_Number { get; set; }
        /// <summary>
        /// 表名
        /// Crm_NewClientData
        /// </summary>
        public string TableName { get; set; }

        /// <summary>
        /// 表名
        /// Crm_NewClientData
        /// </summary>
        public string TableNameStr
        {
            get
            {
                string str = "";
                if (TableName.Equals("Crm_NewClientData")) str = "客户资料(新)";

                return str;
            }
        }

        /// <summary>
        /// 操作端口
        /// </summary>
        public int PortType { get; set; }

        public string PortTypeStr
        {
            get
            {
                string str = "";
                if (PortType == 1) str = "Web";
                else if (PortType == 2) str = "Android";
                else if (PortType == 3) str = "Ios";

                return str;
            }
        }

        /// <summary>
        /// 操作项目
        /// </summary>
        public OperationEnum OperationItem { get; set; }

        public string OperationItemStr
        {
            get
            {
                string str = "";
                if (OperationItem == OperationEnum.NoOperation) str = "未操作";
                else if (OperationItem == OperationEnum.List) str = "浏览列表";
                else if (OperationItem == OperationEnum.Details) str = "浏览详情";
                else if (OperationItem == OperationEnum.Add) str = "添加";
                else if (OperationItem == OperationEnum.Edit) str = "编辑";
                else if (OperationItem == OperationEnum.Del) str = "删除";
                else if (OperationItem == OperationEnum.Audit) str = "审核";
                else if (OperationItem == OperationEnum.Upload) str = "文件上传";
                else if (OperationItem == OperationEnum.Download) str = "文件下载";
                else if (OperationItem == OperationEnum.BatchAssignment) str = "批量指派";
                return str;
            }
        }

        /// <summary>
        /// 数据Id
        /// </summary>
        public int DataId { get; set; }

        /// <summary>
        /// 操作人
        /// </summary>
        public string? OperationUserName { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime CreateTime { get; set; }

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