using Edu.Common;
using Edu.Model.ViewModel.User;
using System;
using System.Collections.Generic;

namespace Edu.Model.ViewModel.Course
{
    /// <summary>
    /// 课程视图实体类
    /// </summary>
    [Serializable]
    public class RB_Course_ViewModel : Model.Entity.Course.RB_Course
    {
        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateByName { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string UpdateByName { get; set; }

        /// <summary>
        /// 创建时间字符串
        /// </summary>
        public string CreateTimeStr { get { return this.CreateTime.FormatTime(); } }

        /// <summary>
        /// 更新时间
        /// </summary>
        public string UpdateTimeStr { get { return this.UpdateTime.FormatTime(); } }

        /// <summary>
        /// 分类名称
        /// </summary>
        public string CateName { get; set; }

        /// <summary>
        /// 分类编号【查询使用】
        /// </summary>
        public string QCateIds { get; set; }

        /// <summary>
        /// 课程编号
        /// </summary>
        public string QCourseIds { get; set; }

        /// <summary>
        /// 是否查询优化价格
        /// </summary>
        public int IsQPrice { get; set; }

        /// <summary>
        /// 是否查询老师
        /// </summary>
        public int IsQTeacher { get; set; }

        /// <summary>
        /// 课程阶梯价格列表
        /// </summary>
        public List<RB_Course_StepPrice_ViewModel> StepPriceList { get; set; }

        /// <summary>
        /// 课程优惠列表
        /// </summary>
        public List<RB_Course_Preferential_Extend> PreferentialList { get; set; }

        /// <summary>
        /// 讲师列表
        /// </summary>
        public List<RB_Teacher_ViewModel> TeacherList { get; set; }

        /// <summary>
        /// 教师团队
        /// </summary>
        public List<int> TeacherIdList
        {
            get
            {
                if (!string.IsNullOrEmpty(this.Teacher_Ids))
                {
                    return Common.ConvertHelper.StringToList(this.Teacher_Ids);
                }
                return new List<int>();
            }
        }

        /// <summary>
        /// 销售平台[修改使用]
        /// </summary>
        public List<int> SalePlatList
        {
            get
            {
                if (!string.IsNullOrEmpty(this.Saleplat))
                {
                    return Common.ConvertHelper.StringToList(this.Saleplat);
                }
                return new List<int>();
            }
        }

        /// <summary>
        /// 销售平台数组
        /// </summary>
        public List<string> SalePlatArr
        {
            get
            {
                List<string> list = new List<string>();
                if (this.SalePlatList != null && this.SalePlatList.Count > 0)
                {
                    foreach (var item in this.SalePlatList)
                    {
                        switch (item)
                        {
                            case 1:
                                list.Add("内部销售");
                                break;
                            case 2:
                                list.Add("学员App");
                                break;
                            case 3:
                                list.Add("网课端");
                                break;
                        }
                    }
                }
                return list;
            }
        }

        /// <summary>
        /// 是否取随机条数
        /// </summary>
        public bool IsRand { get; set; }

        /// <summary>
        /// 随机条数
        /// </summary>
        public int RandNum { get; set; }
    }
}