using Edu.Model.Entity.EduTask;
using System;
using System.Collections.Generic;
using System.Text;

namespace Edu.Model.ViewModel.EduTask
{
    /// <summary>
    /// 上课计划调整视图实体类
    /// </summary>
    public class RB_Change_ClassPlan_ViewModel : RB_Change_ClassPlan
    {
        /// <summary>
        /// 调课计划编号
        /// </summary>
        public string Q_Change_ClassPlan_Ids { get; set; }

        /// <summary>
        /// 班级名称
        /// </summary>
        public string ClassName { get; set; }

        /// <summary>
        /// 调动类型字符串
        /// </summary>
        public string ChangeTypeStr
        {
            get
            {
                string str = "";
                if (this.ChangeType == 1)
                {
                    str = "课程";
                }
                else if (this.ChangeType == 2)
                {
                    str = "老师";
                }
                else if (this.ChangeType == 3)
                {
                    str = "教室";
                }
                else if (this.ChangeType == 4)
                {
                    str = "取消课程";
                }
                return str;
            }
        }

        /// <summary>
        /// 调动选项字符串
        /// </summary>
        public string MoveTypeStr
        {
            get
            {
                string str = "";
                if (this.MoveType == 1)
                {
                    str = "固定日期";
                }
                else if (this.MoveType == 2)
                {
                    str = "全局调整";
                }
                return str;
            }
        }

        /// <summary>
        /// 调整原数据信息
        /// </summary>
        public List<ChangePlanItem> OldChangePlanItemList { get; set; }

        /// <summary>
        /// 调整新数据信息
        /// </summary>
        public List<ChangePlanItem> NewChangePlanItemList { get; set; }

        /// <summary>
        /// 全局修改上课时间
        /// </summary>
        public AllChangePlanItem AllChangePlanModel { get; set; }
    }

    public class ChangePlanItem
    {
        /// <summary>
        /// 上课计划编号
        /// </summary>
        public int ClassPlanId { get; set; }

        /// <summary>
        /// 上课时间
        /// </summary>
        public DateTime ClassDate { get; set; }

        /// <summary>
        /// 上课时间
        /// </summary>
        public string ClassDateStr { get { return Common.ConvertHelper.FormatDate(this.ClassDate); } }

        /// <summary>
        /// 老师编号
        /// </summary>
        public int TeacherId { get; set; }

        /// <summary>
        /// 教师姓名
        /// </summary>
        public string TeacherName { get; set; }

        /// <summary>
        /// 教室编号
        /// </summary>
        public int ClassRoomId { get; set; }

        /// <summary>
        /// 教师名称
        /// </summary>
        public string ClassRoomName { get; set; }

        /// <summary>
        ///班级计划上课日期的上课时间表
        /// </summary>
        public List<Course.RB_Class_Time_ViewModel> PlanTimeList { get; set; }
    }


    /// <summary>
    /// 全局调课修改
    /// </summary>
    public class AllChangePlanItem
    {

        /// <summary>
        /// 总课时
        /// </summary>
        public decimal ClassHours { get; set; }

        /// <summary>
        /// 课时分钟数
        /// </summary>
        public int ClassHourMinute { get; set; }

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

        /// <summary>
        /// 老师编号
        /// </summary>
        public int TeacherId { get; set; }

        /// <summary>
        /// 老师姓名
        /// </summary>
        public string TeacherName { get; set; }

        /// <summary>
        /// 教室编号
        /// </summary>
        public int ClassRoomId { get; set; }

        /// <summary>
        /// 教师名称
        /// </summary>
        public string ClassRoomName { get; set; }

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

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


        /// <summary>
        /// 排课方式(1-周，2-月，3-固定日期，4-约课)
        /// </summary>
        public Common.Enum.Course.ClassStyleEnum ClassStyle { 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; }
    }
}
