using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.Entity.Grade;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;

namespace Edu.Model.ViewModel.Grade
{
    /// <summary>
    /// 班级实体类
    /// </summary>
    [Serializable]
    public class RB_Class_ViewModel : RB_Class
    {
        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateByName { get; set; }

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

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

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

        /// <summary>
        /// 课程名称
        /// </summary>
        public string CourseName { get; set; }

        /// <summary>
        /// 课程特色
        /// </summary>
        public string CourseFeature { get; set; }

        /// <summary>
        /// 课程分类
        /// </summary>
        public string CateName { get; set; }

        /// <summary>
        /// 助教名称
        /// </summary>
        public string AssistName { get; set; }

        /// <summary>
        /// 助教头像
        /// </summary>
        public string AssistIcon { get; set; }

        /// <summary>
        /// 讲师名称
        /// </summary>
        public string TeacherName { get; set; }

        /// <summary>
        /// 讲师头像
        /// </summary>
        public string TeacherHead { get; set; }

        /// <summary>
        /// 教室名称
        /// </summary>
        public string RoomName { get; set; }

        /// <summary>
        /// 报名学员数量
        /// </summary>
        public int OrderStudentCount { get; set; }

        /// <summary>
        /// 学校名称
        /// </summary>
        public string SchoolName { get; set; }

        /// <summary>
        /// 校区负责人编号
        /// </summary>
        public int ManagerId { get; set; }

        /// <summary>
        /// 班级阶梯价列表
        /// </summary>
        public List<RB_Class_StepPrice_ViewModel> ClassStepPriceList { get; set; }

        /// <summary>
        /// 班级上课计划列表
        /// </summary>
        public List<RB_Class_Plan_ViewModel> ClassPlanList { get; set; }

        /// <summary>
        /// 班级上课计划时间
        /// </summary>
        public List<RB_Class_Time_ViewModel> ClassTimeList { get; set; }

        /// <summary>
        ///班级计划默认上课时间
        /// </summary>
        public List<ClassTimeItem> DefaultTimeList { get; set; }

        /// <summary>
        /// 开课时间
        /// </summary>
        public string OpenTimeStr { get; set; }

        /// <summary>
        /// 预计完成时间
        /// </summary>
        public string FinishTimeStr { get; set; }

        /// <summary>
        /// 开班开始时间
        /// </summary>
        public string StartTime { get; set; }

        /// <summary>
        /// 开班结束时间
        /// </summary>
        public string EndTime { get; set; }
        /// <summary>
        /// 查询可报名  1是
        /// </summary>
        public int Q_CanApply { get; set; }

        /// <summary>
        /// 班级ids
        /// </summary>
        public string Q_ClassIds { get; set; }

        /// 选中的周几/或日期数组
        /// </summary>
        public List<string> WeekDayList { get; set; }

        /// <summary>
        /// 月份
        /// </summary>
        public string QMonth { get; set; }

        /// <summary>
        /// 具体开课时间
        /// </summary>
        public string NewPlanDateTime { get; set; }

        /// <summary>
        /// 原班级id
        /// </summary>
        public int OldClassId { get; set; }

        /// <summary>
        /// 班级最新计划Id
        /// </summary>
        public int ClassPlanId { get; set; }

        /// <summary>
        /// 班级最新计划时间
        /// </summary>
        public DateTime? ClassDate { get; set; }

        /// <summary>
        /// 报名截止日期开始
        /// </summary>
        public string JoinStartTime { get; set; }

        /// <summary>
        /// 报名截止日期结束
        /// </summary>
        public string JoinEndTime { get; set; }

        /// <summary>
        /// 课程分类编号
        /// </summary>
        public int CateId { get; set; }


        /// <summary>
        /// 销售平台
        /// </summary>
        public string Saleplat { get; set; }

        /// <summary>
        /// 课程售价
        /// </summary>
        public decimal CourseSellPrice { get; set; }

        /// <summary>
        /// 课程原价
        /// </summary>
        public decimal CourseOriginalPrice { get; set; }

        /// <summary>
        /// 关联其他课程列表
        /// </summary>
        public List<RB_Class_Course_Extend> OtherCourseList { get; set; }

        /// <summary>
        /// 班级状态字符串
        /// </summary>
        public string ClassStatusStr
        {
            get
            {
                string str = "";
                str = Common.Plugin.EnumHelper.ToName(this.ClassStatus);
                return str;
            }
        }

        /// <summary>
        /// 查询有未报满的班级
        /// </summary>
        public int IsQuerySurplus { get; set; }

        /// <summary>
        /// 总的上课次数
        /// </summary>
        public int TotalPlanNum { get; set; }

        /// <summary>
        /// 已上课次数
        /// </summary>
        public int UsePlanNum { get; set; }

        /// <summary>
        /// 多个课程状态（如：2,3）
        /// </summary>
        public string MoreStatus { get; set; }

        /// <summary>
        /// 是否查询剩余的上课计划
        /// </summary>
        public int IsQuerySurplusPlan { get; set; }

        /// <summary>
        /// 查询状态
        /// </summary>
        public string QClassStatus { get; set; }

        /// <summary>
        /// 开班时间
        /// </summary>
        public List<string> ClassDateList { get; set; }

        /// <summary>
        /// 所属科目
        /// </summary>
        public int CourseSubject { get; set; }

        /// <summary>
        /// 科目名称
        /// </summary>
        public string CourseSubjectName { get; set; }

        /// <summary>
        /// 直客首次报名优惠比例
        /// </summary>
        public decimal B2CRatio { get; set; }

        /// <summary>
        /// 直客续费优惠比例
        /// </summary>
        public decimal B2CReNewRatio { get; set; }

        /// <summary>
        /// 一般同行首次报名返佣比例
        /// </summary>
        public decimal B2BRebateRatio { get; set; }

        /// <summary>
        /// 一般同行续费返佣比例
        /// </summary>
        public decimal B2BReNewRatio { get; set; }

        /// <summary>
        /// 校代同行首次报名返佣比例
        /// </summary>
        public decimal SchoolRebateRatio { get; set; }

        /// <summary>
        /// 校代同行续费返佣比例
        /// </summary>
        public decimal SchoolReNewRatio { get; set; }
    }

    /// <summary>
    /// 上课时间配置项
    /// </summary>
    public class ClassTimeItem
    {

        /// <summary>
        /// 上课日期【ClassStyle:1-周(1,2...);2和3(具体日期)；4(暂无)】
        /// </summary>
        public List<string> DateList { get; set; }

        /// <summary>
        /// 具体上课时间
        /// </summary>
        public List<TimeItem> TimeList { get; set; }
    }

    /// <summary>
    /// 上课时间对象
    /// </summary>
    public class TimeItem
    {
        /// <summary>
        /// 开始时间
        /// </summary>
        public string StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public string EndTime { get; set; }

        /// <summary>
        /// 消耗课时
        /// </summary>
        public decimal TimeHour { get; set; }
    }
}