﻿using Cdev.Frameworks.Common;
using Cdev.Frameworks.DataModel;
using System;

namespace Cdev.Core.Cms.Entity
{
    /// <summary>
    /// 广告类型
    /// 图片、动画、文本、代码、页面
    /// </summary>
    public enum EnumAdType
    {
        /// <summary>
        /// 图片
        /// </summary>
        [EnumDisplayName("图片")]
        Image = 1,

        /// <summary>
        /// 动画
        /// </summary>
        [EnumDisplayName("动画")]
        Flash = 2,

        /// <summary>
        /// 文本
        /// </summary>
        [EnumDisplayName("文本")]
        Text = 3,

        /// <summary>
        /// 代码
        /// </summary>
        [EnumDisplayName("代码")]
        Js = 4,

        /// <summary>
        /// 页面
        /// </summary>
        [EnumDisplayName("页面")]
        Page = 5
    }

    [DMTable("cms_ad", "Id", true)]
    public class EAd 
    {
        /// <summary>
        /// Id
        /// </summary>
        public int Id { get; set; }
        
        /// <summary>
        /// 广告描述
        /// </summary>
        public string AdDesc { get; set; }

        /// <summary>
        /// 广告名称
        /// </summary>
        public string AdName { get; set; }

        /// <summary>
        /// 广告类型 图片、动画、文本、代码、页面
        /// </summary>
        public EnumAdType AdType { get; set; }

        /// <summary>
        /// 所属广告版块Id
        /// </summary>
        public int AdZoneId { get; set; }

        /// <summary>
        /// 点击数
        /// </summary>
        public int ClickCount { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 广告文本
        /// </summary>
        public string AdText { get; set; }

        /// <summary>
        /// 图片地址
        /// </summary>
        public string ImageUrl { get; set; }

        /// <summary>
        /// 广告代码
        /// </summary>
        public string AdCode { get; set; }

        /// <summary>
        /// 广告页面链接
        /// </summary>
        public string AdIframe { get; set; }

        /// <summary>
        /// 是否统计点击数
        /// </summary>
        public bool IsCountClick { get; set; }

        /// <summary>
        /// 是否统计浏览数
        /// </summary>
        public bool IsCountView { get; set; }

        /// <summary>
        /// Flash是否透明
        /// </summary>
        public bool IsFlashWmode { get; set; }

        /// <summary>
        /// 广告是否通过审核
        /// </summary>
        public bool IsPassed { get; set; }

        /// <summary>
        /// 最后更新时间
        /// </summary>
        public DateTime LastUpdateTime { get; set; }

        /// <summary>
        /// 链接提示
        /// </summary>
        public string LinkAlt { get; set; }

        /// <summary>
        /// 是否原窗口打开
        /// </summary>
        public bool IsOpenInNewWindow { get; set; }

        /// <summary>
        /// 链接网址
        /// </summary>
        public string LinkUrl { get; set; }

        /// <summary>
        /// 广告过期时间
        /// </summary>
        public DateTime OverdueDate { get; set; }

        /// <summary>
        /// 广告优先级
        /// </summary>
        public int Priority { get; set; }

        /// <summary>
        /// 浏览数
        /// </summary>
        public int ViewCount { get; set; }
    }
}